Here’s a collection of steps needed to create PDF files directly from HTML web pages.

If you’re working on a Ubuntu Linux machine, the first thing you need to do is to install the WKHTMLTOPDF library, by running the following commands into your terminal:

Once the installation is complete, simply run the following command to make sure that everything went well:

This will generate a PDF file called output.pdf which will contain a preview of the Google’s homepage.

Privacy Preference Center