Tuesday, November 22, 2016

Creating a proper PDF out of HTML

If you have ever wanted to generate a nicely looking, non-rasterized, PDF out of HTML, you probably know that's its hard to find a good library for that. So, I think I have something good for you - PhantomJS!PhantomJS seems to offer a great way to generate PDF documents out of HTML pages:

Here is an example:


That sample, and many others, can be found here:

Original thread discussing phantomjs as a means of generating PDF is here:

Original command:

phantomjs.exe examples/rasterize.js sample.html sample.pdf

Even better option would be Webkit to PDF (the same core is used):


No comments:

Post a Comment

Ubuntu 12.04, 14.04, 16.04 - auto start an app or script before login

To run a command or application at startup, even before the user has logged in, you can use this file: /etc/rc.local The commands entered...