Creating PDF's using PHP

半腔热情 提交于 2020-01-06 06:57:31

问题


What I am wanting to do is create a PDF ideally from HTML code. I found a class called dompdf but I'm having issues with font and page breaks.

Does anyone know of another script or even a better way in general to generate PDF files?

The reason why I am converting HTML to PDF is because I want someone to use a WYSIWYG editor to create the contents and click save to generate their PDF file...

Any input would be greatly apprecaited


回答1:


Due to the different nature of PDF and HTML you'll always have to make a few comprimises when trying to convert HTML into PDF.

If this doesn't bother you too much, I'd get started with TCPDF. Its easy to use and has a fairly good grasp of colors, sizes and some other style related HTML attributes.




回答2:


i use this class TCPDF :

http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf




回答3:


If you don't mind a bit of work then you can use Cairo to generate PDFs.




回答4:


You can take a look at html2fpdf. It can accept very basic html and css.



来源:https://stackoverflow.com/questions/2620028/creating-pdfs-using-php

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