Create pdf from HTML book

Calibre is a pretty powerful tool for converting things into ebooks in various formats. Available in a Software Centre near you!

Don't be deceived by its less than beautiful UI, it can do a lot.


The easiest way? File > Print from your browser. Select Print to File as your printer, and it will ask you where you want it. Be sure to mark PDF. Hit "Print" and it will actually be saved to your drive instead of actually printing.


Htmldoc can be useful, see it here; http://www.htmldoc.org/ it is available from software center, sadly the 1.8 version has a problem with unicode encoded files but on many occasions it can still be a saviour, the problem is fixed in the 1.9 development version.

I usually use the wonderful scrapbook extension here; http://amb.vis.ne.jp/mozilla/scrapbook/ for Firefox to capture the web pages, use the editing tools in scrapbook to fix them up if that is needed and then use htmldoc to convert all pages to PDF.


You could try http://www.xhtml2pdf.com/. It's a converter for HTML/XHTML and CSS to PDF. All written in Python.


I would recommend using OpenOffice/LibreOffice to create the PDF. As a test I downloaded the Wget manul (all in one page) and then opened the HTML page in OponOffice and clicked on the "Export Directly to PDF" button. It created the PDF with with an index from the table of contents.

In the past I've found this to be the easiest way to convert HTML pages to PDF. It also allows you to make changes without much effort.

Screenshots:

  • Wget manual exported to PDF using Open Office Wget manual exported to PDF using Open Office

  • Export Directly to PDF option in Open Office Export Directly to PDF option in Open Office