title: PHP: mPDF / pdf library / is it possible to create multiple pdf files in a loop?
body: <p>I'm using mPDF library and I'm trying to write a code which will create <strong>multiple PDF files</strong> at one call (with one opening of: test.php). Problem: always only the first file is downloaded. I know that the question may seems stupid, I've tried to dive deep into google but I can't figure out how to solve this. Maybe someone could lead me on the right path?
  <br><br>
  My logic is:<br>
  - I have one array with all of orders; for each order I would like to create PDF. <br>
  - I loop the array and each time call the MPDF library <br><br></p>
  
  <p><strong>test.php</strong></p>
  
  <pre><code>$myorders = [ 
                  0 =&gt; array (
                  'FirstName' =&gt; 'Asia',
                  'LastName' =&gt; 'Basia',
                  'OrderNr' =&gt; '123'
  
                  ), 
  
                  1 =&gt; array (
                  'FirstName' =&gt; 'Madzia',
                  'LastName' =&gt; 'Siasia',
                  'OrderNr' =&gt; '456'
                  )
             ];
  
  for ($i=0; $i &lt; count($myorders); $i++) { 
      $FirstName = $myorders[$i]['FirstName'];
      $LastName = $myorders[$i]['LastName'];
      $OrderNr = $myorders[$i]['OrderNr'];
      require 'invoice.php';
  }
  </code></pre>
  
  <p><strong>invoice.php</strong></p>
  
  <pre><code>require 'MPDF57/mpdf.php';
  $mpdf=new mPDF();
  $mpdf-&gt;Bookmark('Start of the document');
  $mpdf-&gt;WriteHTML('test test' . $FirstName);
  $mpdf-&gt;Output("filename{$OrderNr}.pdf",'D');
  </code></pre>
  
  <p>Only filename123.pdf is downloaded. Is it not possible to download more than one file? What am I doing wrong? </p>