Random errors when running HTML2PDF conversion on Linux

Question:

Sometimes we get this error and sometimes we don’t.

Exception: Message: Failed to write html string to file. Conditional expression: fout.is_open() Filename : Html2Pdf.cpp Function : GetSettings Linenumber : 775 Error code : 0

And sometimes we get below error highlighted in red.

html2pdf.so: error while loading shared libraries: libXrender.so.1: cannot open shared object file: No such file or directory

Answer:

First, if you are running on 64bit Linux, then running the 64bit version of html2pdf might work better.

Either way, use the ldd command to find out the dependencies that are missing. For instance the following probably need to be installed.

libXext.x86_64 fontconfig.x86_64 libXrender.x86_64 urw-fonts.noarch