How could you dynamically create a pdf within wordpress? [closed]

蹲街弑〆低调 提交于 2019-12-08 16:09:34

问题


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?


回答1:


Take a look at dompdf Its is very easy to use as well as good implementation documentation.




回答2:


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)




回答3:


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).




回答4:


install the pdf creator plugin from this url. Hope this help you.

http://wordpress.org/extend/plugins/kalins-pdf-creation-station/




回答5:


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



来源:https://stackoverflow.com/questions/13133066/how-could-you-dynamically-create-a-pdf-within-wordpress

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!