Page 1 of 1

PHP to PDF Form

Posted: Tue May 20, 2008 4:43 pm
by phaedo5
I can't find this answer anywhere, but maybe I just don't know what I'm searching for.

I have an html form that a user fills in and submits. PHP processes the form and emails the recipient a text email.

However, I want to send the user a pdf file. I have a pdf form with a bunch of fields that correspond with the html form. I want the user to submit the form and using php fill in the appropriate text boxes. After which I can send a pretty little pdf with all the form fields necessary already populated.

Any help on where to go with this? I've seen a little on PDFlib. But can it open a pre-made pdf and fill in the fields as needed?

Re: PHP to PDF Form

Posted: Tue May 20, 2008 5:47 pm
by flying_circus
I am using PDFlib to take the data from a HTML form and position it over the PDF file.

Step 1) opens my existing PDF file and sets it as a background image of a new PDF document. (this loses the PDF form functionality).

Step 2) read in form data, then super-impose the text over top of the background image.

Step 3) Save the file and email.

I've been looking for a better solution and I believe the answer lies with FDF, though I just havent had enough time to go through it and update my code.

http://us3.php.net/manual/en/book.fdf.php