PHP to PDF Form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
phaedo5
Forum Newbie
Posts: 6
Joined: Tue May 20, 2008 4:42 pm

PHP to PDF Form

Post 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?
User avatar
flying_circus
Forum Regular
Posts: 732
Joined: Wed Mar 05, 2008 10:23 pm
Location: Sunriver, OR

Re: PHP to PDF Form

Post 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
Post Reply