title: Using FPDI and FDP to generate slightly different pdf files
body: <p>i first import a pdf using fpdi to make a fpdf object, i then perform several changes on that pdf. I clone it to make a custom pdf just adding some texts. Then i output the two files to disk but just one is created and i got a fatal error for the second output : </p>
  
  <p><b>Fatal error</b>: Call to undefined method stdClass::closeFile() in <b>C:\Program Files\EasyPHP 3.0\www\oursin\oursin\public\scripts\FPDI\fpdi.php</b> on line <b>534</b><br /> </p>
  
  <p>pieces of my code: </p>
  
  <pre><code>$pdf = new FPDI('L','mm',array(291.6,456)); 
  $fichier=$repertoireGrilles.'GR_IFR.pdf';   
  
  $pdf-&gt;setSourceFile($fichier); 
  // add a page 
  $tplIdx = $pdf-&gt;importPage(1); 
  $pdf-&gt;AddPage(); 
  $pdf-&gt;useTemplate($tplIdx,0,0,0); 
  .. 
  ... 
  methods on $pdf 
  .. 
  .. 
  .. 
  
  $pdfCopie=clone $pdf; 
  
  methods on $pdfCopie
  
  $pdfCopie-&gt; Output($repertoireGrilles.'grillesQuotidiennes/'.$date.'/Grille_'.$date.'_'.$ou.'_copie.pdf','F'); 
  $pdf-&gt; Output($repertoireGrilles.'grillesQuotidiennes/'.$date.'/Grille_'.$date.'_'.$ou.'.pdf','F'); 
  </code></pre>
  
  <p>Anybody to help me to tackle this issue that keeps my brain under high pressure for hours (days) :) ?</p>