title: PHP Insert multiple PDF's into PDF on specific page number
body: <p>My problem is - A user can upload a PDF-File and now I want to add other (between 1 and n) single page PDF's after every Page of the user uploaded PDF. </p>
  
  <p>For example a user uploads a PDF with 4 Pages and I have got 3 single page PDF's on my Webserver that I want to merge with the user PDF. The resulting PDF should then look like this:</p>
  
  <blockquote>
    <p>Page 1: Page #1 from User uploaded PDF</p>
    
    <p>Page 2: First Single-Page-PDF from Webserver</p>
    
    <p>Page 3: Page #2 from User uploaded PDF</p>
    
    <p>Page 4: Second Single-Page-PDF from Webserver</p>
    
    <p>Page 5: Page #3 from User uploaded PDF</p>
    
    <p>Page 6: Third Single-Page-PDF from Webserver</p>
    
    <p>Page 7: Page #4 from User uploaded PDF</p>
    
    <p>Page 8: First Single-Page-PDF from Webserver</p>
  </blockquote>
  
  <p>So far I've tried it with <strong>PDFMerger</strong></p>
  
  <pre><code>$pdf = new PDFMerger;
  
  $pdf-&gt;addPDF('samplepdfs/userpdf.pdf', 'all')
      -&gt;addPDF('samplepdfs/one.pdf', 'all')
      -&gt;addPDF('samplepdfs/two.pdf', 'all')
      -&gt;addPDF('samplepdfs/three.pdf', 'all')
      -&gt;merge('file', 'xxx/result.pdf');
  </code></pre>
  
  <p>but this only adds the other PDF's at the end..
  Is there a solution in PHP where I can specify the number of the page where the other PDF's shall be inserted?</p>