We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

NullPointerException When converting PCL to PDF

I am using Aspose for Java and I am attempting to convert a PCL file to a PDF using the following code:

import com.aspose.pdf.Document;
import com.aspose.pdf.PclLoadOptions;

public class ConvertPCL {

public static void main(String[] args) {
PclLoadOptions loadoptions = new PclLoadOptions();
Document doc = new Document(“test.pcl”, loadoptions);
doc.save(“test.pdf”);
}
}

I have tried with a number of different versions. My initial licensed version was Aspose for Java 11.3.0. This version outputs a PDF file, but it is just a blank page. I have also tried version 16.12 and 17.2.0 with our license as these are both within our free upgrade time period. These version both produce a NullPointerException. I also downloaded a trial version of version 19.10 (the latest version at this time) and this also gives a NullPointerException. Here is the stack trace for that:

Exception in thread “Thread-3” java.lang.NullPointerException
at com.aspose.pdf.internal.pcl.util.SoftFontHelper.lI(Unknown Source)
at com.aspose.pdf.internal.pcl.util.SoftFontHelper.lt(Unknown Source)
at com.aspose.pdf.internal.pcl.util.SoftFontHelper.lj(Unknown Source)
at com.aspose.pdf.internal.pcl.composer.lt.lI(Unknown Source)
at com.aspose.pdf.internal.l93if.le.lI(Unknown Source)
at com.aspose.pdf.internal.pcl.composer.lt.lI(Unknown Source)
at com.aspose.pdf.internal.pcl.composer.lt.run(Unknown Source)
at java.lang.Thread.run(Thread.java:748)

Can you please let me know what I might be missing? FYI, I am compiling and running the under Java 1.8_202

@dankick

Would you please share your sample PCL file with us so that we can test the scenario in our environment and address it accordingly.