Unable to convert HTML to PDF on some machines

We are unable to convert HTML file to PDF on some machines. We are using Aspose PDF version 19.10.

Following is the code sample we are using:
public class AsposePOC2 {
// Absolute path to html file path
private static final String INPUT_FILE_PATH = “smail.html”;
// Absolute path to where output pdf file needs to be created
private static final String OUTPUT_FILE_PATH = “smail.pdf”;
// Absolute path to license path
private static final String LICENSE_FILE_PATH = “Aspose.Total.Java.lic”;

public static void start() throws Exception {
    Path inputPath = Paths.get(INPUT_FILE_PATH);
    if(Files.notExists(inputPath)){
        throw new Exception("Failed to access input file");
    }

    Path licensePath = Paths.get(LICENSE_FILE_PATH);
    if(Files.notExists(licensePath)){
        throw new Exception("Failed to access license file");
    }

    Path outputPath = Paths.get(OUTPUT_FILE_PATH);
    Files.deleteIfExists(outputPath);

    try(InputStream inputStream = Files.newInputStream(inputPath);
        OutputStream outputStream = Files.newOutputStream(outputPath)){
        HtmlLoadOptions options = new HtmlLoadOptions();
        License license = new License();
        license.setLicense(Files.newInputStream(licensePath));
        Document pdfDocument = new Document(inputStream, options);
        pdfDocument.save(outputStream);
    }catch (Exception e){
        e.printStackTrace();
    }
    System.out.println("DONE!!");
}

}

We are getting NullPointerException with following stacktrace:
at com.aspose.pdf.internal.l29if.le.lt(Unknown Source)
at com.aspose.pdf.internal.l29if.le.lh(Unknown Source)
at com.aspose.pdf.internal.l29if.le.le(Unknown Source)
at com.aspose.pdf.internal.l29if.le.lf(Unknown Source)
at com.aspose.pdf.internal.l44l.lI.lI(Unknown Source)
at com.aspose.pdf.internal.l44l.lI.lI(Unknown Source)
at com.aspose.pdf.internal.l44l.lI.lI(Unknown Source)
at com.aspose.pdf.internal.l42l.lc.lc(Unknown Source)
at com.aspose.pdf.internal.l42l.lt.l1n(Unknown Source)
at com.aspose.pdf.internal.l42l.l0l.l6f(Unknown Source)
at com.aspose.pdf.internal.l42l.l0l.lI(Unknown Source)
at com.aspose.pdf.internal.l42l.l0l.lI(Unknown Source)
at com.aspose.pdf.internal.l42l.lk.lI(Unknown Source)
at com.aspose.pdf.internal.l42l.lk.lI(Unknown Source)
at com.aspose.pdf.internal.l42l.l1l.lI(Unknown Source)
at com.aspose.pdf.internal.l42l.l1l.lI(Unknown Source)
at com.aspose.pdf.internal.l42l.l1l.lI(Unknown Source)
at com.aspose.pdf.internal.l42l.l1l.lI(Unknown Source)
at com.aspose.pdf.internal.l42l.l3n.lI(Unknown Source)
at com.aspose.pdf.internal.l42l.lf.lI(Unknown Source)
at com.aspose.pdf.internal.l42l.l3n.lI(Unknown Source)
at com.aspose.pdf.internal.l42l.l3n.lj(Unknown Source)
at com.aspose.pdf.internal.l42l.lf.lI(Unknown Source)
at com.aspose.pdf.internal.l42l.l3n.lI(Unknown Source)
at com.aspose.pdf.internal.l42l.l4if.l2n(Unknown Source)
at com.aspose.pdf.internal.l38t.lb.lf(Unknown Source)
at com.aspose.pdf.internal.l39y.lk.l0p(Unknown Source)
at com.aspose.pdf.internal.l39l.lf.lI(Unknown Source)
at com.aspose.pdf.internal.l39l.lf.lI(Unknown Source)
at com.aspose.pdf.internal.l39l.lf.lI(Unknown Source)
at com.aspose.pdf.internal.l38if.lj.lI(Unknown Source)
at com.aspose.pdf.internal.l38l.lI.lI(Unknown Source)
at com.aspose.pdf.internal.l46f.lI.lI(Unknown Source)
at com.aspose.pdf.internal.l38n.lt.lI(Unknown Source)
at com.aspose.pdf.internal.l38n.lf.lj(Unknown Source)
at com.aspose.pdf.internal.html.collections.lf.lj(Unknown Source)
at com.aspose.pdf.internal.html.collections.lf.hasNext(Unknown Source)
at com.aspose.pdf.internal.l46f.lI.lI(Unknown Source)
at com.aspose.pdf.internal.html.rendering.HtmlRenderer.render(Unknown Source)
at com.aspose.pdf.internal.html.rendering.HtmlRenderer.render(Unknown Source)
at com.aspose.pdf.internal.html.rendering.Renderer.render(Unknown Source)
at com.aspose.pdf.internal.html.rendering.Renderer.render(Unknown Source)
at com.aspose.pdf.l6u.lI(Unknown Source)
at com.aspose.pdf.l6u.lI(Unknown Source)
at com.aspose.pdf.ADocument.lI(Unknown Source)
at com.aspose.pdf.ADocument.(Unknown Source)
at com.aspose.pdf.Document.(Unknown Source)
at com.example.demo.AsposePOC.start(AsposePOC.java:62)
at com.example.demo.DemoApplication.main(DemoApplication.java:12)

@poladiaraj

Can you please make sure that all Windows Fonts are installed in the system where this exception is being thrown. Also, please try to use the latest available version i.e. 23.6 and if issue still persists, please share your sample HTML in .zip format along with the complete environment details i.e. JDK Version, OS Name and Version, etc. We will test the scenario in our environment and address it accordingly.

Even after installing all the fonts on machine the issue is reproducible on version 19.10. When I used version 19.11 the issue was not reproduced. There is nothing special in HTML file we are using sample HTML content. Below is the content of HTML File:

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
</body>
</html>

JDK version: 11.0.11+9
OS Name: Windows 10
OS Version: 22H2
OS Build: 19045.3086

All the details are identical on both the machines on which issue is reproducible and not reproducible.

Only difference was in fonts.

@poladiaraj

This issue might be related to the fonts in 19.10 version and could have been resolved in higher version(s). However, please note that the support is provided on the basis of the latest version of the API as we always recommend using the latest available version. In case an issue is not occurring using the latest version of the API, we cannot resolve it in the older versions. Therefore, please use the latest version of the API and if issue still persists, please let us know.