title: FPDI format error: not a PDF or corrupted
body: <p>I am trying to import a pdf document with FPDI and add some text to it but when I try to open the new pdf get the error message "format error: not a PDF or corrupted"!</p>
  
  <p>Here is the code:</p>
  
  <p>require_once ('fpdf.php'); 
  require_once ('fpdi.php'); </p>
  
  <pre><code>// initiate FPDI 
  $pdf = new FPDI();
  // add a page kl
  $pdf-&gt;AddPage(); 
  // set the sourcefile 
  $pdf-&gt;setSourceFile('doc1.pdf'); 
  // import page 1 
  $tplIdx = $pdf-&gt;importPage(1); 
  // use the imported page  
  $pdf-&gt;useTemplate($tplIdx); 
  
  // now write some text above the imported page 
  $pdf-&gt;SetFont('Arial'); 
  $pdf-&gt;SetTextColor(255,0,0); 
  $pdf-&gt;SetXY(25, 25); 
  $pdf-&gt;Write(0, "This is just a simple text"); 
  
  $pdf-&gt;Output('newpdf.pdf', 'D'); 
  </code></pre>
  
  <p>I downloaded this code from the FPDI website and customized this.
  The PDF version of my file is 1.3 . (The documentation says FPDI can work with PDFs up to version 1.5)
  Tried older versions of FPDI and fpdf_tpl.php but still get this error.
  I couldn't find the answer neither with GOOGLE nor in this forum!</p>
  
  <p>Any help appreciated!</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>In the meantime I found the problem!</p>
  
  <p>All the files were up to date except FPDF! I used an old version of FPDF. Now I use 1.7 instead of 1.5.</p>