title: DOMPDF Multiple Documents Generated In One PDF
body: <p>I am using DOMPDF to generate invoices.
  1 invoice at time is perfect.</p>
  
  <p>But i want to print (from a while) all invoices between date
  all is perfect
  But Dompdf print only the last invoice.</p>
  
  <p>The dompdf code</p>
  
  <pre><code>require_once("dompdf_config.inc.php");
  $date1 = "2008-01-01";
  $date2 = "2009-01-01";
  $user = "User_1"; 
  
  $sql=mysql_query("SELECT * FROM invoices  WHERE datum BETWEEN '$date1' AND '$date2' AND user='$user' ORDER BY nummer ");
  while ($rows=mysql_fetch_array($sql))
  {
  $num=$rows[number];
  $datum=$rows[data];
  $pay=$rows[pay];
  
  // Need to get the user info from other table
  $Query2 = "SELECT * from user WHERE user='$user'";
  while ($rows2=mysql_fetch_array($Result2))
  {
  $name = $rows2[name];
  //ETC...
  
  // Now we generate the html invoice
  $html =
      '&lt;html&gt;&lt;body&gt;'.
  //the invoice html
      '&lt;/body&gt;&lt;/html&gt;';
  
  $dompdf = new DOMPDF();
  $dompdf-&gt;load_html($html);
  $dompdf-&gt;render();
  }
  }
  $dompdf-&gt;stream("Invoice.pdf");
  </code></pre>
  
  <p>I want to get all invoices ( sometimes 5, sometimes 50 ) in 1 pdf file.
  How to ? </p>
  
  <p>I close my whiles at end of files, but don't help.</p>
  
  <p>Hope you can help.</p>