title: Edit Existing PDF multiple page File using FPDF & FPDI
body: <p>I am usinf FPDI to edit my existing pdf file and its work perfect for single page.
  As ou can see i am editing my <code>$tplIdx = $pdf-&gt;importPage(1);</code> first page.
  I have six page pdf file and need to add 2 variable in different page.</p>
  
  <p>Is is possible ? How?</p>
  
  <pre><code>&lt;?php
  require_once('fpdf.php');
  require_once('fpdi.php');
  
  // initiate FPDI
  $pdf = new FPDI();
  // add a page
  $pdf-&gt;AddPage();
  // set the sourcefile
  $pdf-&gt;setSourceFile('ex.pdf');
  
  // import page 1
  $tplIdx = $pdf-&gt;importPage(1);
  
  
  // use the imported page and place it at point 10,10 with a width of 100 mm
  $pdf-&gt;useTemplate($tplIdx, 10, 10, 200);
  
  // now write some text above the imported page
  $pdf-&gt;SetFont('Arial');
  $pdf-&gt;SetTextColor(255,0,0);
  $pdf-&gt;SetXY(50, 50);
  $pdf-&gt;Write(0, "Ajay Patel");
  
  $pdf-&gt;Output('newpdf1.pdf', 'D');
  ?&gt;
  </code></pre>
  
  <p>Thanks In Advance !</p>