title: PDF Form filling with FPDF and then Flatten with PDFTK displays un-filled PDF
body: <p>I'm using the "Form Filling" script from fpdf.org to fill some fields on a PDF Form I created. This appears to work properly. </p>
  
  <p>I want the resulting PDF form to be flattened so users can not edit the form fields. I'm using <a href="http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/">PDFTK</a> for that. However, when I try to flatten the PDF, I get a PDF with the form fields empty.  </p>
  
  <p>Any suggestions on how to get the PDF flattened (using PHP) would be appreciated. Thanks!</p>
  
  <p>Here's my code:</p>
  
  <pre><code>&lt;?php
  require('fpdm.php');
  $fields = array("Name" =&gt; "John Doe", 
                  "Address" =&gt; "123 White Lane", 
                  "Age" =&gt; "30", 
                  "Phone" =&gt; "123-1234");
  $pdf = new FPDM("templates/Test.pdf");
  $pdf-&gt;Load($fields, true);
  $pdf-&gt;Merge();
  $pdf-&gt;Output("cache/Filled1.pdf","F");
  
  exec("pdftk cache/Filled1.pdf output cache/Filled1Flat.pdf flatten");
  ?&gt;
  </code></pre>
  
  <p>Download original Test.pdf file: <a href="http://www.geo3o.com/KeyTech/pdf2/templates/Test.pdf">Test.pdf</a></p>
  
  <p>Download Filled1.pdf file (displays pdf form correctly with data visible): <a href="http://www.geo3o.com/KeyTech/pdf2/cache/Filled1.pdf">Filled1.pdf</a></p>
  
  <p>Download Filled1Flat.pdf file (displays flattened pdf form with no form data visible): <a href="http://www.geo3o.com/KeyTech/pdf2/cache/Filled1Flat.pdf">Filled1Flat.pdf</a></p>