I am trying to generate a printable version of the HTML page, the printable version should have left pane and top pane stripped off. I tried to generate the printable version using JQuery, it has some layout issues while getting the stripped of content into the print preview screen(which is another stripped off HTML in pop up window).
Is there any ready made open source tool which converts HTML to PDF without much effort, because I have already lost quite a bit of time trying to explore in JQuery
I am using Grid 960 template layout
When you have processed the html, wkhtmltopdf (Windows/Mac/Linux) can convert it to pdf. wkhtmltopdf is a cross-platform, open source (LGPLv3) command line tool to render HTML into PDF and various image formats using the Qt WebKit rendering engine. These run entirely "headless" and do not require a display or display service.
wkhtmltopdf can be downloaded from the official wkhtmltopdf website. It is also in the default repositories of most common Linux distributions.
Examples
Convert a remote HTML file to PDF:
wkhtmltopdf http://www.google.com example.pdf
Convert a local HTML file to PDF:
wkhtmltopdf example.html example.pdf
wkhtmltopdf usage You can also display the wkhtmltopdf help locally by running wkhtmltopdf -H
.
why not just use a print stylesheet, and let your users print to PDF if they want to?
http://www.alistapart.com/articles/goingtoprint/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With