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

Windows Articles

How to install Redis on CentOS 8?

Hello, friends in this post, we will show you how to install Redis on CentOS 8 As we well...

How to enable and disable startup applications in Windows 10

Hello! Windows 10 is an attractive and very easy to use system. However, some criticism has come for being too "heavy". That...

How to install Oracle Java 15 on Ubuntu 20.04 / 18.04?

Hello, friends. We know that Java is one of the most popular programming languages and now it's version 15. So in this...

How to run the Linux Tail command in Windows 10.

Hi! The title of this post may seem incongruous, but it's not. In fact, for some time Microsoft has approached positions with...

How to compress large videos in Windows 10

Hello, how are you? Multimedia resources are definitely used in any system. Indeed, we live in the age of technology. That's why...
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

How to install Redis on CentOS 8?

Hello, friends in this post, we will show you how to install Redis on CentOS 8 As we well...

How to enable and disable startup applications in Windows 10

Hello! Windows 10 is an attractive and very easy to use system. However, some criticism has come for being too "heavy". That...

How to install Oracle Java 15 on Ubuntu 20.04 / 18.04?

Hello, friends. We know that Java is one of the most popular programming languages and now it's version 15. So in this...

How to run the Linux Tail command in Windows 10.

Hi! The title of this post may seem incongruous, but it's not. In fact, for some time Microsoft has approached positions with...

How to compress large videos in Windows 10

Hello, how are you? Multimedia resources are definitely used in any system. Indeed, we live in the age of technology. That's why...
x