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.