Issue while converting HTML to PDF using Aspose.Pdf library in Java

Hi,

We are trying to convert an HTML to PDF in java using licensed Aspose.Pdf 19.12 version library. We are trying this on a red hat linux machine. The linux machine has no MS Fonts installed, however it has default jre fonts present. The conversion is not happening as it is throwing Null Pointer Exception. How can we make use of jre default fonts to make the conversion work?

Please guide us as it is a blocker for us.

@kumaramit183

First of all, please make sure to use the latest version of the API as it has more enhancements and fixes. Furthermore, we always recommend to use the latest version as the support is provided on its usage basis.

You can use setLocalFontPaths() method of FontRepository Class in Aspose.PDF for Java to set the default font folder to JRE fonts. The API will look for fonts in the specified folder and use them during conversion. In case you still face any issue, please let us know.