title: TCPDF and FPDI: Is there a separate version of FPDI for TCPDF than for FPDF
body: <p>I'm trying to build an header generator for pdf worksheets.</p>
  
  <p>My choice of technologies were:
  FPDF and FPDI</p>
  
  <p>Now, I'm transistioning to TCPDF and FPDI, because the powers that be have decided we need water marks (transparencies). </p>
  
  <p>According to the FPDI website, switching is as easy as changing all your require/include statements to say tcpdf.php instead of fpdf.php but in my code below:</p>
  
  <pre><code>//... Code to generate appropriate Graph ...
  PDFGenHelper::saveIMG($graph,$imgfilepath);
  $filename = "template.pdf";
  $pdf = new FPDI();
  $pdf-&gt;AddPage();
  
  $pdf-&gt;setSourceFile($filename);
  $tplIdx = $pdf-&gt;importPage(1);
  $pdf-&gt;useTemplate($tplIdx);
  
  $pdf-&gt;Image($imgfilepath, 168, 13, 35, 65);
  
  $pdf-&gt;Write(5, "This is just a simple text"); //This line
  
  $pdf-&gt;Output($dircache.$userID.'_'.$excerciseID.'_package.pdf', 'F');
  </code></pre>
  
  <p>Seems to generate an error that says:
  Warning: Division by zero in <em>Appropriate directory stuff here</em>/lib/fpdf/fpdf.php on line 819</p>
  
  <p>I've removed all the references to fpdf in my code but it seems to still be coming up with that. </p>
  
  <p>Also, when I try to print to the PDF using the inherited methods from FPDF:</p>
  
  <pre><code>$pdf-&gt;SetFont('Arial','B',25);
  $pdf-&gt;Cell(40,10,'Hello World!');
  </code></pre>
  
  <p>This will generate text. In addition the FPDI website says FPDI has a Dependency on FPDF_TPL file which looking into the file tells me it extends FPDF.</p>
  
  <p>So to my question: How do you configure FPDI to work with TCPDF instead of FPDF?</p>