title: FPDF-Merge Error: field not found in pdf template using fpdm.php to fill form data
body: <p>I'm using this FPDF script from <a href="http://www.fpdf.org/en/script/script93.php" rel="nofollow">http://www.fpdf.org/en/script/script93.php</a> to fill html form data to pdf fields in a template. This:</p>
  
  <pre><code>require('fpdm/fpdm.php');
  
  $fields = array(
      'name'  =&gt; $_POST['_fid_6'],
      'address'  =&gt; $_POST['_fid_7'],
      'city'  =&gt; $_POST['_fid_8'],
  );
  
  $pdf = new FPDM('template.pdf');
  $pdf-&gt;Load($fields, false); // second parameter: false if field values are in ISO-8859-1, true if UTF-8
  $pdf-&gt;Merge();
  $pdf-&gt;Output('qaf.pdf', 'F'); 
  </code></pre>
  
  <p>works fine when I use the example template.pdf provided in the zip. But when I use my own pdf template (template3.pdf), and this:</p>
  
  <pre><code>require('fpdm/fpdm.php');
  
  $fields = array(
      'cascade'  =&gt; $_POST['_fid_6'],
      'structuretype'  =&gt; $_POST['_fid_7'],
      'marketmanager'  =&gt; $_POST['_fid_8'],
  );
  
  $pdf = new FPDM('template3.pdf');
  $pdf-&gt;Load($fields, false); // second parameter: false if field values are in ISO-8859-1, true if UTF-8
  $pdf-&gt;Merge();
  $pdf-&gt;Output('qaf.pdf', 'F'); 
  </code></pre>
  
  <p>I get the error <strong>FPDF-Merge Error: field cascade not found</strong></p>
  
  <p>I'm using Acrobat XI Pro. I've triple checked the field names in my pdf template &amp; html form. I've optimized the pdf to remove compression and fast web view, and made it compatible with Acrobat 5.0 and later. My template is 7 pages, but I tried it as only 1 page with the same result. I've experimented with discarding other data and objects, but still get the same error.</p>
  
  <p>There must be something in my pdf template that is different than the template.pdf in the example, and is causing the error. But I have no idea what it could be. I can't include my actual template pdf here, because it is proprietary.</p>
  
  <p>Any ideas on what might be causing the error?? Thanks!</p>
  
  <ul>
  <li>Cross-posted here: <a href="http://www.fpdf.org/phorum/read.php?f=1&amp;i=60387&amp;t=60387" rel="nofollow">http://www.fpdf.org/phorum/read.php?f=1&amp;i=60387&amp;t=60387</a></li>
  </ul>