Merging data into pdf form

124 views
Skip to first unread message

J Sherman

unread,
Feb 20, 2014, 8:50:37 AM2/20/14
to pdfhummus-in...@googlegroups.com
I am looking to fill out pdf form field from a node.js database.  Any tips on getting form filed coordinates to use when appending the database text.  

Gal Kahana

unread,
Feb 26, 2014, 1:50:52 AM2/26/14
to pdfhummus-in...@googlegroups.com
Hi,
Normally a PDF form is implemented using an AcroForm. To fill out automatically you are not required to look for the physical position of the elements. Rather you can access them via the form PDF object and set their values. in addition to just setting the values you also get to set their appearance. There is a bit of PDF theory to know in order to implement this as the library does not yet implement high level methods for filling forms. In essence you need to parse the form from the Catalog PDF object. Get the /AcroForm entry in the catalog object. then you can get to the list of fields through the /Fields entry. For each fields there's a V entry which contains the value. Another entry (AP) sets the appearance.

You will need to learn a bit about modification with the javascript module. The relevant documentation is here:

There was a discussion about implementing this in C++, which you can look into to get clues on implementation, as the Javascript commands are very similar:
Gal.
Reply all
Reply to author
Forward
0 new messages