How To: Convert webpage HTML to PDF on Ubuntu Linux

Convert webpage HTML to PDF on Ubuntu Linux

There's plenty of reasons why one would want to convert a webpage to a PDF document. And there's numerous ways on how one can convert that web page (HTML) into a PDF file. Check out this video tutorial on how to convert webpage HTML to PDF on Ubuntu Linux.

You could just select "Print" (in Firefox: File… Print), and then select "Print to file" and the output "PDF".

But some pages with lots of CSS, javascript, and so on, won't be displayed correctly. For this, see the second method of converting webpages (HTML) to PDF (below).

Using wkhtmltopdf:

To install wkhtmltopdf in Ubuntu, run the following command in a terminal:

sudo apt-get install wkhtmltopdf

Then, to convert a webpage to PDF, open a terminal and type this:

wkhtmltopdf ~/Desktop/bbc.pdf

Replacing and bbc.pdf with the website you want to convert to PDF / the name you desire for the converted PDF file.

With wkhtmltopdf, you can disable the javascript on the page if you want, change the quality, orientation (portrait or landscape), and more. Too see everything wkhtmltopdf can do, type:

wkhtmltopdf --help

Tru3m0sl3m has all kinds of tutorials, from Windows and Ubuntu Linux operating systems to Islamic videos. If you're looking for some quick and handy computer tips or tricks, this is a good place to start.

Want to master Microsoft Excel and take your work-from-home job prospects to the next level? Jump-start your career with our Premium A-to-Z Microsoft Excel Training Bundle from the new Gadget Hacks Shop and get lifetime access to more than 40 hours of Basic to Advanced instruction on functions, formula, tools, and more.

Buy Now (97% off) >

Other worthwhile deals to check out:

Join the Next Reality AR Community

Get the latest in AR — delivered straight to your inbox.

Be the First to Comment

Share Your Thoughts

  • Hot
  • Latest