I’m using a Contact Form 7 to have the users enter data, then based on their data entry, I need to add different text to the pdf before outputting the entire pdf.
For example, if the user says they like red balloons, the created balloon pdf will mention how important red balloons are, etc…
I know there must be a way to do this using fpdf, tcpdf, or something, but I’m not sure how. Any ideas?
Take a look at dompdf Its is very easy to use as well as good implementation documentation.
You may wish to use PHP’s native PDF functions wrapped in a custom WordPress plugin to generate your own PDF documents. Check out the PHP.net Manual: PDF for an overview. I’m there there are plenty of
PHP=>PDF
vendor libraries out there if you search the Google’s.Another solution, off the top of my head, would be to run a worker process somewhere to convert and return documents in [?|PDF] formats based on WordPress data fed through a template system (mustache, twig, etc).
create a child plugin, this guy done it or is doing it: http://wordpress.org/support/topic/plugin-contact-form-7-add-attachment-with-wpcf7_contactform-class?replies=1
First of all I really recommend using Gravity Forms, it’s a better plugin for forms and it also saves entries in the database so you can retrieve them.
For the PDF part, I think you need to program it manually.
Create a php file that implements tcpdf, and receives all input from the form (via POST or GET). Then you have all the parameters you need and you can create the PDF in any way you like.
In order to use this php file, open a Page in WordPress and then rename the php file to page-.php (where XXXX is the new Page ID you opened)
install the pdf creator plugin from this url. Hope this help you.
http://wordpress.org/extend/plugins/kalins-pdf-creation-station/