How to render HTML into PDF files

wkhtmltopdf and wkhtmltoimage are open source (LGPLv3) command line tools to render HTML into PDF and various image formats using the QT Webkit rendering engine. These run entirely “headless” and do not require a display or display service.

Install wkhtmltopdf and its requried packages

Generate pdf files from html by this command