Recursive HTML to PDF

I would suggest installing the WKHtmlToPDF tool from http://wkhtmltopdf.org/ (moved from: http://code.google.com/p/wkhtmltopdf/).

You can then change to the root folder and use find and xargs to convert them:

cd /main-folder
find . -name \*.html | sed 's/.html$//g' | xargs -n 1 --replace=X wkhtmltopdf X.html X.pdf

This will then build a PDF with each HTML file.


The following command should do the job for one link:

gnome-web-print http://www.ubuntu.com ubuntu.pdf

For multiple links, it shouldn't be difficult to write a loop that handles each link one by one.

Tags:

Html

Pdf