Learn How To Install HTMLDoc on Fedora 29

February 11, 2020

Table of Contents

If you are using a different system, please check our other tutorials.

HTMLDoc will dynamically parse Postscript (PDF 1.6) documents from correctly written Hypertext (HTML 3.2). This will allow you to generate PDF files on-the-fly, without having to spend hours setting up your server environment or having to pay enormous sums of money to acquire said capability. It can be used for all type of documents, from receipts and invoices, to brochures and documentation, and much more.

In this tutorial, you will learn what is needed to install HTMLDoc on Fedora 29.

Once HTMLDoc has been installed, we shall continue by creating a simple one-page document, an HTML template we will generate our first PDF document from.

Install HTMLDoc

For this tutorial, we will be working with IT Web Services’s Fedora 29 (x64) server with IPv4. Keep in mind, this works the same with IPv6 only servers as well.

Log in as root and install htmldoc.

dnf install htmldoc -y

You are now ready to start generating PDF documents from HTML markup.

Generating Your First PDF from HTML

Let’s quickly test this newfound capability from the command-line. Move over to the /tmp/ directory for testing:

cd /tmp/

Now, let’s create a simple HTML document, which we will use to generate a PDF document. We can call it markup-source.html:

nano markup-source.html

Add the following HTML markup to it:

<title>My first PDF from HTML</title>
This is the body of my first PDF document made from HTML.

Save it by hitting CTRL + X to exit Nano editor, then input y to save the changes. You can now instruct HTMLDoc to parse a PDF document from your markup-source.html file:

htmldoc --webpage -f postscript-output.pdf markup-source.html

You will now have a new file named postscript-output.pdf with a title of “My first PDF from HTML” and a body of “This is the body of my first PDF document made from HTML”. Congratulations, you have learned how to turn simple HTML markup to highly transportable PostScript PDF documents.

Need help?

Do you need help setting up this on your own service?
Please contact us and we’ll provide you the best possible quote!