I spent a lot of time 2-3 years ago assessing different tools to convert HTML+CSS to PDF [1]. At the time, this was to convert HTML plus custom tags into well-formatted legal documents. At the time the hands down winner was Prince XML [2]. It's relatively expensive ($3800 for a single server license) but it just works , works from many languages and produces beautiful results quickly (look at their samples). It doesn…
I used wkhtmltopdf in a previous project and found it to be extremely reliable and easy to use. I was extracting the HTML mime parts from incoming email, converting them to PDFs with wkhtmltopdf, then converting that to a PNG with ImageMagick and displaying the PNG to the user in a web browser.
Wkhtmltopdf, shell utility to convert html to pdf using webkit rendering engine
21–30 of 40 posts
Re: Wkhtmltopdf, shell utility to convert html to pdf using webkit rendering engine
#22It's practically unusable when not in an environment with X11. I had to use it on a Windows system and any text would have incorrect letter-space. Every letter would bleed into the next, it's a typographic nightmare. You could use Arial Unicode MS to get a somewhat acceptable result but that won't support bold or italic text cleanly. I'm not quite sure but I think the fix isn't even part in the 0.11 release. One has…
Re: Wkhtmltopdf, shell utility to convert html to pdf using webkit rendering engine
#23Earlier quoted context omitted.
Well, I am looking for some feedback on a project that converts XML to PDF. Give it a try: https://github.com/kelvin0/PyXML2PDF
I am looking for a command-line utility that could do: webpage2pdf 'http://bit-player.org/deck.js/limits-to-growth-Harvard-2012-03-30/ltg-talk.html#Lotka-Volterra' slide.pdf and actually work (create a sensible PDF representation of what I can see in a browser). So my feedback wouldn't be useful, as my use case is out of scope for your project: "PyXML2PDF is NOT compatible with any XHTML/HTML/CSS. It uses a small set…
Re: Wkhtmltopdf, shell utility to convert html to pdf using webkit rendering engine
#24I used it with wget to scrape a site for conversion: http://darrenknewton.com/blog/2011/10/30/mirror-site-and-con...
Re: Wkhtmltopdf, shell utility to convert html to pdf using webkit rendering engine
#25Earlier quoted context omitted.
How specifically did you use PhantomJS for PDF generation?
There's an example here: http://code.google.com/p/phantomjs/wiki/QuickStart#Rendering (gives examples of .png and .pdf generation)
Only problem was getting the screenshot to work with Flash. It seems as thought the javascript delay option on wkhtmltopdf didn't delay at all.
Can PhantomJS handle pages with Flash?
Re: Wkhtmltopdf, shell utility to convert html to pdf using webkit rendering engine
#26Earlier quoted context omitted.
I am looking for a command-line utility that could do: webpage2pdf 'http://bit-player.org/deck.js/limits-to-growth-Harvard-2012-03-30/ltg-talk.html#Lotka-Volterra' slide.pdf and actually work (create a sensible PDF representation of what I can see in a browser). So my feedback wouldn't be useful, as my use case is out of scope for your project: "PyXML2PDF is NOT compatible with any XHTML/HTML/CSS. It uses a small set…
Would it be sufficient to create PNGs of the web pages and extract the text of the webpage to place in the background of a PDF file (for search, screenreading)?
Re: Wkhtmltopdf, shell utility to convert html to pdf using webkit rendering engine
#27Re: Wkhtmltopdf, shell utility to convert html to pdf using webkit rendering engine
#28Earlier quoted context omitted.
I used wkhtmltopdf in a previous project and found it to be extremely reliable and easy to use. I was extracting the HTML mime parts from incoming email, converting them to PDFs with wkhtmltopdf, then converting that to a PNG with ImageMagick and displaying the PNG to the user in a web browser.
Why bother with the intermediate stage and not go direct html-to-png?
EDIT: A PDF will also let you select text, unlike an image. However, an image is nicer to embed in a webpage. So I utilised both in order to get the best of both worlds.
Re: Wkhtmltopdf, shell utility to convert html to pdf using webkit rendering engine
#29Does anyone know of any other engines like this, either paid or free? We are using this to produce catalogs of 200+ complex pages and it is not handling generating PDFs of this size very well. It will often become unresponsive and create a memory leak.
Re: Wkhtmltopdf, shell utility to convert html to pdf using webkit rendering engine
#30Earlier quoted context omitted.
There's an example here: http://code.google.com/p/phantomjs/wiki/QuickStart#Rendering (gives examples of .png and .pdf generation)
Thank you for posting. I recently did a bit of research on producing thumbnails with Ruby using this project: https://github.com/csquared/IMGKit . Only problem was getting the screenshot to work with Flash. It seems as thought the javascript delay option on wkhtmltopdf didn't delay at all. Can PhantomJS handle pages with Flash?