简体   繁体   中英

Html Content To Pdf Conversion

I want to convert HTML content to pdf. It can be any content ie content of a div, table etc.

I have tried jspdf, iText for it but they are not effective.

Among the paid one's pdfcrowd is solving my purpose but I am looking for any open source solution which does not depend third party server.

Please suggest any open source solution to this which can convert html content to pdf effectively(Client Side will be preferable).

In Windows, Mac or Linux, install wkhtmltopdf . wkhtmltopdf is a command line utility to convert HTML to PDF using WebKit. You can download wkhtmltopdf from the linked webpage, or in many Linux distros it can be found in their repositories.

Examples

Convert a remote HTML file to PDF:

wkhtmltopdf http://www.google.com google.pdf

Convert a local HTML file to PDF:

wkhtmltopdf example.html example.pdf

You can also display wkhtmltopdf help locally by running wkhtmltopdf -H . 您还可以通过运行wkhtmltopdf -H在本地显示wkhtmltopdf帮助。

You can try htmltopdf for convert HTML content into a pdf. I have used it and it fulfills my all requirements of converting HTML into pdf. http://www.phpclasses.org/package/2905-PHP-Convert-HTML-to-PDF-using-Web-services.html

You can use TCPDF for converting HTML to PDF . its free and good features. I tried and its working perfectly even you can convert all html content like images ,or custom css into pdf without any problem by using TCPDF classes .

You can download form below link: http://sourceforge.net/projects/tcpdf/files/

Regards, Sanjeev Kumar Goswami

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM