Can't convert html to pdf

Product: PDFTron

Product Version: PDFTron Java - v9.1.0

Please give a brief summary of your issue:
Can’t convert HTML to pdf in container

Please describe your issue and provide steps to reproduce it:
I have a simple code to convert HTML to pdf and it works when running in my machine (linux), but when I run it in a docker container using openjdk:8 image it won’t work. I have configured the html2pdf modules and set permission for read/write/execute, and there isn’t any exception or error even when using the getLog() method from HTML2PDF it just returns an empty string.

PDFDoc doc = new PDFDoc();
HTML2PDF converter = new HTML2PDF();

Please provide a link to a minimal sample where the issue is reproducible:

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:


Most likely this is a dependency issue. What exact Linux distro are you using in your Docker container?

It’s using Debian GNU/Linux 11

Another thing I’ve noticed is that when it works, it prints in the log:

Permission: html2pdf
Permission: write

but when not it just print:
Permission: html2pdf

Currently we just have Debian9 and Debian10 builds. Do either of these work for you?

If you are having issues you can simply call to see what the missing dependency is.


Thank you, that helped me identify the missing packages and now it works

I had this very same issue and was also able to identify some missing dependencies but after installing them I get another error:
Missing output file /tmp/pdftron/Trn-1-1647609886-0c96d1ca-e9b1-40ec-b0b3-59baf8e312b3

I saw another post suggesting that this could be related to execution rights on the but this is not the case. It has full execution rights.
Can you please help?

Please note that we have released a new major update to our HTML2PDF module.

I suggest updating to latest PDFNet 9.2 SDK and latest HTML2PDF module.

Hi Ryan
I was already using the latest version of the SDK and have tried downloading the latest version of the conversion module to no avail.
I still get the same error.
Any ideas?

Would you be able to provide the latest error message that you get?

I set up a test container to check the dependencies for the HTML2PDF module using the openjdk:8 image and checked for missing dependencies. The following is a list of missing dependencies for this image that must be installed for the module:

bash-4.4# ldd | grep “not found” => not found => not found => not found

You may also need to install fontconfig.

Bruce Tompkinson