php - Zend_Pdf manipulating PDF Form Fields -
i have project there number of forms processed , stored in db. upon successful completion admin notified email contents of form submission.
the problem 1 of these forms need mail order version have in pdf format.
so have 2 basic options:
- figure out coordinates of "field" need write to, , overlay drawn text @ coordinates
- turn pdf pdf form using acrobat pro's form wizard , set field values programmatically
option 1 know doable. i've done similar things before. problem form pretty complex , there lot of coordinates figure out... moreover, there lot of trial , error process.
option 2 seems easier long can access fields through iteration or name/id , set values.
so question is, zend_pdf support manipulation of pdf form fields? dont see in api other submit , reset form actions denote supports this.
additionally, if there other oo f/oss pdf libraries support option 2 interested in hearing them alternative approaches.
sorry bit late thought may useful...
if have access add components server can use pdf labs pdf tooklit (pdftk) library - command line utility can accessed system/exec/passthru commands in php. can see pdftk info here: http://www.pdflabs.com/docs/pdftk-man-page/ pdftk allow merge pdfs, add background pdfs , fill form fields within pdf (plus loads more) - see fill_form switch.
if can add pdftk server can use andrew heiss's pdftk-php class make easier update form fields in pdf info pulled db - can see more info at: https://github.com/andrewheiss/pdftk-php/
one last comment - if ever wanting create pdfs on fly directly html far best solution wkhtml2pdf - http://code.google.com/p/wkhtmltopdf/ - works pdf screenshot of html screen (a little more complex idea).
as can tell have been working on similar problem , have gone through soooo many headaches working solution.
Comments
Post a Comment