How To Install HTMLDoc on Ubuntu 18.04

 

 

 

HTMLDOC is a software program designed to read HTML and Markdown sources or web pages and generate EPUB, HTML, PostScript, or PDF documents that contain a table of contents. With HTML templates, you can utilize the entire print area of a PDF document. Using HTMLDoc, you can parse Postscript documents based on correctly formed Hypertext. 

 

 

 

 

The following tutorial includes instructions on how to install HTMLDoc on Ubuntu 18.04.

 

 

 

 

 

So let’s begin,

 

 

 

 Prerequisites

  • A fresh Ubuntu 18.04 VPS on the VPSie Cloud Platform.
  • Configure a root password on your server.

 

 

 

Step 1: Set up a VPSie cloud server 

 

 

 

 

Start by logging into your VPSie account Make a new server, with at least 2 GB of RAM in the operating system (Ubuntu 18.04) with IPv4. Use the credentials that we emailed you to connect to your Cloud Server via SSH.

 

 

 

As soon as you are logged into Ubuntu 18.04, type the following command to install the latest packages onto your base system.


 

apt-get update && apt-get upgrade -y

 

 

 

Now, let’s install HTMLDoc,

 

 

apt-get install htmldoc -y

 

From now on, you can generate PDF documents using HTML markup.

 

 

 

 

 

Take a first Look at PDF Generation from HTML,

 

 

 

 

Let’s put it to the test. Browse the following directory.


 

cd /tmp/

 

The next step is to create an HTML document, from which a PDF will be generated. Let us call it HTML2PDF.


 

nano HTML2PDF.html

 

 

 

Mark it up like this,



<html>
<head>
    <title>PDF from HTML</title>
</head>
<body>
    PDF document made from HTML.
</body>
</html>

 




The changes can be saved by pressing CTRL + X and then Y to save the changes. The next step is to parse your HTML2PDF.html.

 


htmldoc --webpage -f output.pdf HTML2PDF.html


You will now have a new file named output.pdf







Thanks for reading! I hope it was informative for you! 

 

 

 

 


 

 

Try VPSie for free today!