title: MPDF generates in a multiple pages instead of one page
body: <p>I am using MPDF 5.4, When I try to take PDF it shows the records in a number of pages instead of one page. for example if I have 50 records it needs only one page but PDF generates in 23 pages. This occurs when I selects a particular category and take PDF. When I try to echo the content variable it shows the records correctly aligned.</p>
  
  <pre><code> &lt;?php 
      include("../MPDF54/mpdf.php");
      $mpdf   =   new mPDF('utf-8','A4', 0, '', 0, 0, 12, 12, 0, 0, 'L');
      //$mpdf-&gt;myvariable = file_get_contents($image_url);
      ?&gt;
      &lt;?php 
      $content_html   =   '&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
      &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
      &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
      &lt;title&gt;Item Report&lt;/title&gt;
      &lt;style type="text/css"&gt;
      body{margin:0px; padding:0px; text-align: justify; font-family: Arial, Helvetica, sans-serif; font-size:12px; line-height:20px; color:#000}
      &lt;/style&gt;
      &lt;/head&gt;
      &lt;body&gt;
  
  
  
      &lt;div style="float:left; width:100%; padding:0%; margin-top:0px;"&gt;
  
  
  
  
  
      &lt;table width="100%" border="0" cellspacing="0" cellpadding="10"&gt;
                                      &lt;thead&gt;
                                          &lt;tr height="33" bgcolor="#666" style="color:#FFFFFF" align="left"&gt;
                                              &lt;th align="left" style="color:#FFFFFF"&gt;Description&lt;/th&gt;
                                              &lt;th align="left" style="color:#FFFFFF"&gt;Part No.&lt;/th&gt;
                                    &lt;th align="left" style="color:#FFFFFF"&gt;Location Code&lt;/th&gt;
                                    &lt;th align="left" style="color:#FFFFFF"&gt;Open Qty&lt;/th&gt;
                                    &lt;th align="left" style="color:#FFFFFF"&gt;Total IN&lt;/th&gt;
                                    &lt;th align="left" style="color:#FFFFFF"&gt;Total OUT&lt;/th&gt;
                                              &lt;th align="left" style="color:#FFFFFF"&gt;Bal Qty&lt;/th&gt;
                                          &lt;/tr&gt;
                                      &lt;/thead&gt;
                                      &lt;tbody&gt;';
  
  
                                      $slno=0;
                                      $category_name  =   "";
                                      foreach($array_item_list as $itemlist){
                              $slno++;
                              if($slno%2)
                                          $row_style  =   'style="background:#fff;"';
                                      else
                                          $row_style  =   'style="background:#e9e9e9;"';
  
                                      if($itemlist['category_status']=="A"){
                                      if($item_category){
                                 if($item_category==$itemlist['category_id']){
                                 $item_count_arr  =   $ObjItem-&gt;getitemdetails('','',$search_text,'A',$itemlist['category_id'],$item_type);
                                 $item_count  =   $ObjItem-&gt;_num_rows;
                                 }else{
                                    $item_count    =  0;
                                 }
                              }else{
                              $item_count_arr =   $ObjItem-&gt;getitemdetails('','',$search_text,'A',$itemlist['category_id'],$item_type);
                                      $item_count =   $ObjItem-&gt;_num_rows;
                              }
  
                                      if($item_count&gt;=1){
                                      if ($itemlist['category_name'] != $category_name) {
                                          $category_name = $itemlist['category_name'];
                                          //print "&lt;h1&gt;".$category_name."&lt;/h1&gt;\n";
  
                                      $content_html .= '&lt;tr&gt;                           
                                          &lt;td style="font-weight:bold;background:#ddd;" colspan="8"&gt;'. $category_name .'&lt;/td&gt;
                                      &lt;/tr&gt;';
                                       }
                                      if($itemlist['item_id']!=""){
                                      if($itemlist['item_part_no']) $item_part_no = $itemlist['item_part_no']; else $item_part_no = '--';
  
                                      $location_id    =   $itemlist['item_location_id'];
                                      $location_arr   =   $ObjLocation-&gt;getLocationDetails($location_id,'','','A','');
                                      if($location_arr){
                                          $location_name          =   $location_arr[0]['location_name'];
                                          $location_description   =   $location_arr[0]['location_description'];
                                      }
  
                                      $qty_arr                        =   $ObjStockReport-&gt;getTotalQty($itemlist['item_id'],'IN');
          if($qty_arr[0]['total_qty']) $in_qty = $qty_arr[0]['total_qty']; else $in_qty = '0';
  
                                      $qty_arr                        =   $ObjStockReport-&gt;getTotalQty($itemlist['item_id'],'OUT');
          if($qty_arr[0]['total_qty']) $out_qty = $qty_arr[0]['total_qty']; else $out_qty = '0';
  
                              if($itemlist['item_open_qty'])
                                 $item_open_qty = $itemlist['item_open_qty'];
                              else
                                 $item_open_qty = '0';
  
                              if($itemlist['item_balance_qty'])
                                 $item_balance_qty = $itemlist['item_balance_qty'];
                              else
                                 $item_balance_qty = '0';
  
                                      $content_html .= '&lt;tr '.$row_style.'&gt;   
                                              &lt;td&gt;'. $itemlist['item_name'] .'&lt;/td&gt;
                                              &lt;td&gt;'. $item_part_no .'&lt;/td&gt;
                                    &lt;td&gt;'. $location_description .'&lt;/td&gt;
                                    &lt;td&gt;'. $item_open_qty .'&lt;/td&gt;
                                    &lt;td&gt;'. $in_qty .'&lt;/td&gt;
                                    &lt;td&gt;'. $out_qty .'&lt;/td&gt;
                                    &lt;td&gt;'. $item_balance_qty .'&lt;/td&gt;
                                          &lt;/tr&gt;';
                                           }
  
                                      }   }    }                                  
  
  
                                      $content_html .= '&lt;/tbody&gt;
                                  &lt;/table&gt;';
  
  
      $content_html .= '&lt;/div&gt;
  
      &lt;/body&gt;
      &lt;/html&gt;';
      $mpdf-&gt;SetHTMLHeader('&lt;div style="float:left; width:96%; padding:0 2%; padding-top:3px; height:42px; background:#212121; "&gt;
      &lt;div style="float:left; width:50%; margin-top:5px;"&gt;&lt;img src="../assets/img/login_icon2.png"/&gt;&lt;/div&gt;
      &lt;div style="float:right; width:49%; margin-right:1%; text-align:right; margin-top:12px; color:#FFFFFF; text-transform:uppercase; font-size:20px;"&gt;Item Report&lt;/div&gt;
      &lt;/div&gt;');
      $mpdf-&gt;SetHTMLFooter('&lt;div style="width:96%; padding:0 2%; padding-top:3px;  height:42px; background:#bbb; color:#000; "&gt;
      &lt;div style="float:left; width:50%; margin-top:5px;text-align:left; margin-top:12px;"&gt;'. date('d-m-Y H:i a') .'&lt;/div&gt;
      &lt;div style="float:right; width:49%; margin-right:1%; text-align:right; margin-top:12px; color:#000; font-size:12px;"&gt;Arabinfotech L.L.C.&lt;/div&gt;
      &lt;/div&gt;');
      $mpdf-&gt;WriteHTML($content_html);
      $mpdf-&gt;Output();
      ?&gt;
  </code></pre>