coupe-r Posted September 5, 2010 Share Posted September 5, 2010 Hi Everyone, I will have a web application that users fill out and submit. I also have the same form in PDF format. I would like users to be able to click a print preview button, then open up FoxIt or Adobe and display the PDF, with their answers mapped to the correct location. I have no code, just looking for a direction and didn't know what to search for. Thanks. Quote Link to comment Share on other sites More sharing options...
objnoob Posted September 5, 2010 Share Posted September 5, 2010 Check out TCPDF at http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf There is an examples page which will guide you through creating and modifying PDF files! Quote Link to comment Share on other sites More sharing options...
coupe-r Posted September 5, 2010 Author Share Posted September 5, 2010 Thanks for the reply.. I looked at the site, but it looks like thats for generating a PDF with PHP. I already have a PDF of the application. For instance: On my PDF application, there are spaces for first name, last name, etc. The same fields are on the online form. Basically, I want my database to populate the PDF file, based on the users response. So if they filled first name and last name on the online form and press print preview, both elements would be printed on the PDF. Is that what this site allows you to do? They have 30-40 different links and none seem like they would. Quote Link to comment Share on other sites More sharing options...
coupe-r Posted September 6, 2010 Author Share Posted September 6, 2010 I saw fPDF.org as well, but it looks like that still creates a PDF of your page? Just need to map answers from my DB to my PDF, not make a PDF. Quote Link to comment Share on other sites More sharing options...
objnoob Posted September 6, 2010 Share Posted September 6, 2010 Try some of these linkages: http://www.mactech.com/articles/mactech/Vol.20/20.11/FillOnlinePDFFormsUsingHTML/index.html http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ http://www.pdf-tools.com/ Cheaper to just create the darned PDF on the fly pdftk looks promising. Quote Link to comment Share on other sites More sharing options...
objnoob Posted September 6, 2010 Share Posted September 6, 2010 Look up FDF! And check this out: http://koivi.com/fill-pdf-form-fields/ Very good finds, I hope. Quote Link to comment Share on other sites More sharing options...
coupe-r Posted September 6, 2010 Author Share Posted September 6, 2010 Thanks, I have some reading to do.... Quote Link to comment Share on other sites More sharing options...
objnoob Posted September 6, 2010 Share Posted September 6, 2010 From pdftk man pages: fill_form < FDF data filename | XFDF data filename | - | PROMPT > Fills the single input PDF’s form fields with the data from an FDF file, XFDF file or stdin. Enter the data filename after fill_form, or use - to pass the data via stdin, like so: pdftk form.pdf fill_form data.fdf output form.filled.pdf After filling a form,the form fields remain interactive unless you also use the flatten output option. flatten merges the form fields with the PDF pages. You can use flatten alone, too, but only on a single PDF: pdftk form.pdf fill_form data.fdf output out.pdf flatten or: pdftk form.filled.pdf output out.pdf flatten If the input FDF file includes Rich Text formatted data in addition to plain text, then the RichText data is packed into the form fields as well as the plain text. Pdftk also sets a flag that cues Acrobat/Reader to generate new field appearances based on the Rich Text data. That way, when the user opens the PDF, the viewer will create the Rich Text fields on the spot. If the user’s PDF viewer does not support Rich Text, then the user will see the plain text data instead. If you flatten this form before Acrobat has a chance to create (and save) new field appearances, then the plain text field data is what you’ll see in the flattened PDF. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.