I gave you sudo, just fix it.
PDF Forms
One of our clients has a simple enough request. They wanted a PDF form to be populated in with a set of values gathered from a web form. We decided to settle on xfdf as a method to do this.
I wasn't familiar with xfdf, but was pleased to discover it is an easy format.
<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
<fields>
<field name="firstname">
<value>Dan</value>
</field>
<field name="lastname">
<value>Cocos</value>
</field>
<field name="email">
<value>dan@echoditto.com</value>
</field>
</fields>
<f href="example.pdf"/>
</xfdf>
Now that the xfdf problem was solved we had to move on next to adding the fields to the PDF. We were unable to find suitable PHP libraries to handle it. Luckily there is a free and open source Java* library iText that does all of this and more.
Miles an EchoDitto intern took the first crack at it and had a working example in no time. A little bit of code clean up and voila a short while later a working tool to merge form data into a PDF.
*There is also a C# port for those so inclined.






Comments
Would this have helped? PHP PDF library called TCPDF: http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf
1 July 2009
48 weeks 4 days
It doesn't handle xfdf from what I can tell.
Using Drupal? Why don't you use the fillpdf module?