Create PDF file with contents from the database

穿精又带淫゛_ 提交于 2019-12-11 03:40:39

问题


I would want to print tickets in pdf. I was already able to retrieve the ticket details like customer name, order id, order items, and total bill. I would want to put this details in the .pdf file ready for printing. I'm using html and php tags in retrieving these ticket details from the database. How can I convert to .pdf all items echoed in .php file?


回答1:


You can use a library like dompdf.




回答2:


I personally prefer TCPDF to create PDFs from PHP. It's still actively being developed and has a lot of features you don't find in other libs (yet). Just look at their examples page to see how easy it is to use.




回答3:


Try to use

http://pear.php.net/package/File_PDF




回答4:


You can find exactly what you need.. http://www.fpdf.org/en/script/script10.php Also many useful exaplmes are given here. FPDF



来源:https://stackoverflow.com/questions/3500576/create-pdf-file-with-contents-from-the-database

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