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.
PDFNet.initialize(LICENSE_KEY);
HTML2PDF.setModulePath(MODULE_PATH);
PDFDoc doc = new PDFDoc();
HTML2PDF converter = new HTML2PDF();
htmlConvert.insertFromHtmlString("<html><body><h1>Heading</h1><p>Paragraph.</p></body></html>");
converter.convert(doc);
Please provide a link to a minimal sample where the issue is reproducible:
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 html2pdf_chromium.so but this is not the case. It has full execution rights.
Can you please help?
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?
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 html2pdf_chromium.so | grep “not found”
libnss3.so => not found
libnssutil3.so => not found
libnspr4.so => not found