Command line utility that is able to convert html documents (both on- and offline (local)) to a pdf, including ability to generate a table of contents, header/footer and a dedicated cover page. Formatting is covered by CSS, and scripts are being executed.
In ruby the following gems/plug-ins are available that utilize this utility: Wicked PDF and PDFKit. For me, however, the command line option worked more flexibly and predictably. HTML+CSS is rather limited. For full control something like Prawn might be of help, although I haven’t used it myself (too much hassle), or try passing a custom XSL with WKHTMLTOPDF.
Back to WKHTMLTOPDF: To prevent breaks in your tables/images see the following comment and this bug report.
To fix font rendering on debian systems, see this comment.