How To Install HTMLDoc on Debian 9
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 Debian 9. After installing HTMLDoc, we will create an example document with one page, no headers, footers, borders, or extras.
So let’s begin,
Prerequisites
- A fresh Debian 9 VPS on the VPSie Cloud Platform.
- Configure a root password on your server.
Configure VPSie cloud server
- Sign in to your system or register a newly created one by logging in to your VPSie account.
- Connect by SSH using the credentials we emailed you.
- Once you have logged into your Debian instance, run these commands to update your system.
apt-get update && apt-get upgrade -y
The software packages have now been updated, so HTMLDoc can now be installed,
apt-get install htmldoc -y
Using HTML markup, you can now generate PDF documents.
Creating Your First HTML PDF
Let’s put it to the test. Browse the following directory.
cd /tmp/
Next, let’s create an HTML file, from which a PDF can be generated. The file can be named HTML2PDF.html, for example.
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!