Webkit2pdf is a little tool designed to fetch web pages and export them to numbered PDF files (or to print them). It allows specifying paper size and output directory. It is released under the terms of the GPL, version 2 or later.
Webkit2pdf currently works on POSIX platforms like GNU/Linux. It should be portable to Windows, but I have currently no interest in doing that.
Sources |
Webkit2pdf is also available pre-packaged in various Linux distributions, like Debian, Ubuntu, Mandriva,
SuSE, Gentoo, and maybe more. Simply use your normal package manager to install Webkit2pdf.
If you want to compile Webkit2pdf from the sources, you will need Webkit, GTK+, Poppler-glib, and their
respective development packages. Webkit must be version r42436 or newer.
I wrote Webkit2pdf to be able to export more than 200 posts from my wife's pregnancy blog. It allowed us to print it (via lulu.com) as a future souvenir for our son, without using a whole week-end doing it manually. I just had to tweak the blog's "print media" CSS for a very good-looking result. (See screenshots!)
You can simply use XVFB, the X Virtual FrameBuffer:
xfvb-run -a webkit2pdf -f test.%04d.pdf http://webkit2pdf.sf.net/
The graphical user interface |
The command-line interface |
Example output (printed by Lulu.com) |
Please report bugs on the bug tracker. You can also email Colin, the author.