wkhtmltopdf.org
wkhtmltopdf and wkhtmltoimage are open source command line tools that render HTML into PDF and image formats using the Qt WebKit rendering engine. They run headless without a display or display service. A C library, libwkhtmltox, offers bindings for PDF and image conversion.