go ahead... be a heretic | |
PerlMonks |
Re: Filling out PDF forms with data from DBI?by Thelonius (Priest) |
on Jun 22, 2006 at 04:44 UTC ( [id://556830]=note: print w/replies, xml ) | Need Help?? |
You can easily create an FDF file with the data for the fields. For example, using your example file, you can create fw9a_data.fdf:
Using the free Acrobat Reader, I copied fw9.pdf to fw9a.pdf, filled in a few fields, then used the menu command "Document|Forms|Export Data from Form..." to create "fw9a_data.fdf". I have thrown in a few line breaks to make it readable. If you give the user the two files "fw9a_data.fdf" and "fw9a.pdf", they can then open this in Acrobat or Acrobat Reader. (E.g., by double-clicking fw9a_data.fdf) If you want to just create a printable PDF, you could use the command-line pdftk utility. It's possible that CAM::PDF may be able to do this, but I haven't gotten it to install properly. In the merged file, the form data is in there twice, once as form data and once as print instructions, e.g. for the name/address field, pdftk creates this object which will tell a PDF renderer how to print the data:
The output from pdftk is a PDF file that is printable, but you can't edit and resave the data in the free Adobe Reader. (You might be able to edit it in full Adobe.) The IRS forms are editable in Adobe Reader because the IRS paid for an expensive Adobe product that signs the file. (See http://seclists.org/lists/vulnwatch/2003/Jan-Mar/0103.html and http://weblog.infoworld.com/udell/2003/09/04.html.)
In Section
Seekers of Perl Wisdom
|
|