"be consistent" | |
PerlMonks |
Re^2: Filling out PDF forms with data from DBI?by mercutio_viz (Scribe) |
on Jun 24, 2006 at 07:06 UTC ( [id://557361]=note: print w/replies, xml ) | Need Help?? |
It looks like L~R is right on the money with CAM::PDF. I've spent a lot of time with PDF::API2 but I think that CAM::PDF is better suited for this task. In the case of of the aforementioned W-9 form, with its non-descript field names, I wrote an inelegant-but-useful piece of code that helps to identify the actual field locations:
This revealed that each digit in the SSN and tax ID number fields is actually a form field. I would assume that Randal would need to analyze each form so as to know which fields are what, and then create the appropriate mapping from DBI fields to PDF form fields. On this particular form I noticed that the check boxes were not form fields. Randal, does your client require a check mark on the document, e.g. for "sole proprietor" or "Corporation?" The only reason I ask is because I don't see an easy means to add a check mark using CAM::PDF. PDF::API2 or PDF::Reuse can do that easily. However, they don't have the easy interface into forms the way CAM::PDF does. It might be a bit of a kludge, but running through CAM::PDF to fill in the forms and then running through PDF::API2 to add any checkmarks (or any kind of glyphs or graphics) would be pretty easy. To add a check mark on "Corporation" you could just do this:
These are just some thoughts. Please let us know what you eventually come up with. I'm curious to see how this looks in a production environment. -MC
In Section
Seekers of Perl Wisdom
|
|