HTML to PDF with HTMLDoc on Debian 10 /Debian 9 / Ubuntu / Linux Mint

Windows Articles

Top 8 features for power users in Windows 10

Hello! Windows 10 is full of features and functions. In fact, that's one of the reasons it's so popular and used. Because it can...

How to access System in Windows 10

Perhaps the title of this post is misleading. In previous versions of Windows, it was enough to enter the Control Panel and from there,...

Microsoft reduces the fragmentation of Windows 10

Windows 10 20H2 has been released as a minor operating system update. As a result, it has managed to reduce platform errors. In addition,...

How to install Nginx and PHP on FreeBSD?

Hello, friends. FreeBSD is a secure system even more than Linux, that's why it's used as the main server. And a server has to...

How to enable local port forwarding using Ubuntu 20.04 and ssh

SSH, a very popular tool found almost with every IT guy. Commonly, when we talk about the insecure network for data, ssh is the...
angeloma
angeloma
Senior Writer and partner

PDF is a fairly common format today for distributing documents. It has great popular support and is widely supported by many communities. In addition to this, almost all office tools support it on almost all known platforms. From the desktop with Windows, Linux, MacOS and BSD; to the mobile with Android and iOS. Then it’s a good idea to have tools that can take advantage of them. Today, I will teach you how to install and use HTMLDoc to generate a PDF file based on HTML.

What is HTMLDoc?

HTMLDOC is a program that reads HTML and Markdown source files or web pages and generates corresponding EPUB, HTML, PostScript, or PDF files with an optional table of contents.

One of the best things about this program is that it is released under GPL v2. That is, we will have no problem using it. If you are a developer, it is also a great advantage because we can include or use them in our project without problems.

How to install and use it?

The program is available for Linux through the official repositories of each distribution. This at least, in Debian and derivative. However, you can download the source code from GitHub. It is not very large.

In Debian and derivatives, just open a terminal and run the following:

:~$ sudo apt install htmldoc

Once the installation is complete, we are ready to begin.

First of all, I recommend you to check the help page of the command. To do this, type:

:~$ htmldoc --help

1.- HTMLDoc help
1.- HTMLDoc help

As we can see there are many options that alter the operation of the command. One thing to keep in mind is that HTMLDoc does not support CSS or Emojis correctly. So be careful. To get it up and running, just use this command:

:~$htmldoc --webpage -f [output_file].pdf [input_file]

However, you can use a webpage on the [input_file] field.

If we want to modify the margins, we can do it with these options:

  • –top
  • –bottom
  • –left
  • –right

Another quality of HTMLDoc is to allow not to compress anything of the resulting file so as not to lose quality. For this use the --no-compression option.

As you can see, it’s easy to use.

Tell us, have you used it? do you like it? have you integrated it into your projects? Let us know in the comments

Please share this post with your friends.

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

Top 8 features for power users in Windows 10

Hello! Windows 10 is full of features and functions. In fact, that's one of the reasons it's so popular and used. Because it can...

How to access System in Windows 10

Perhaps the title of this post is misleading. In previous versions of Windows, it was enough to enter the Control Panel and from there,...

Microsoft reduces the fragmentation of Windows 10

Windows 10 20H2 has been released as a minor operating system update. As a result, it has managed to reduce platform errors. In addition,...

How to install Nginx and PHP on FreeBSD?

Hello, friends. FreeBSD is a secure system even more than Linux, that's why it's used as the main server. And a server has to...

How to enable local port forwarding using Ubuntu 20.04 and ssh

SSH, a very popular tool found almost with every IT guy. Commonly, when we talk about the insecure network for data, ssh is the...
x