views:

162

answers:

2

I have a PDF document that represents a print form that is normally filled out by hand.

I want to to programatically populate certain text fields in the document (it is not a PDF form, just a plain PDF document) and fill it out with data specific to each user of the site.

I want the end form to look like it was passed through a typewriter and had data typed in (doesn't have to appear as if it was hand written.)

The end result should be a new PDF document with the data filled in.

+1  A: 

Read the PDF Document as a Template (background-image) and write your Text over the template. I've done this in PHP with the free fpdf_tpl and the fpdi libraries.

I don't know the python world very well but there is this SO post about python and pdf

tharkun
+1  A: 

I once had to populate customized forms for a "large-ish" number of clients (10 pages of form x ~900 clients). I built the forms as normal PDF forms, then output the data into .fdf files (which are plain-text), and finally used iTextSharp for the merge and print.

It worked well for a one-off, but I don't know if I'd do it on a regular basis that way.

Of course, that was with C#; for Java, you'd go with iText ... Sorry, I'm not a python-er.

Adrien