We are getting a strange exception now, but have our licenses set. The exception occurs when trying to convert a PCL file to PDF.
Exception: java.lang.NullPointerException: Cannot invoke “com.aspose.pdf.internal.pcl.parser.PCLParser.getOptions()” because the return value of “com.aspose.pdf.internal.pcl.composer.Composer.getParser()” is null
We are using aspose-pdf 20.6. Do you know how we can resolve this issue? It works locally, but does not work when deployed.
Can you please try using Aspose.PDF for Java 23.8 and let us know if issue still persists? Please share your sample file with us as well so that we can test the scenario in our environment and address it accordingly.
PS: Also, make sure that all windows fonts are installed in the system where this exception is occurring.
Gotcha, thanks so much for the reply. We are getting a strange exception now, but have our licenses set. The exception occurs when trying to convert a PCL file to PDF.
Exception: java.lang.NullPointerException: Cannot invoke “com.aspose.pdf.internal.pcl.parser.PCLParser.getOptions()” because the return value of “com.aspose.pdf.internal.pcl.composer.Composer.getParser()” is null
We are using aspose-pdf 20.6. Do you know how we can resolve this issue? It works locally, but does not work when deployed.
Can you please try using Aspose.PDF for Java 23.8 and let us know if issue still persists? Please share your sample file with us as well so that we can test the scenario in our environment and address it accordingly.
PS: Also, make sure that all windows fonts are installed in the system where this exception is occurring.
Hello, thanks for getting back to me. The system does have all the windows fonts. We do not currently have access to Aspose.PDF Java 23.8, is there a bridge solution available in our current version?
Also, the code fails on this line:
com.aspose.pdf.PclLoadOptions pclLoadOptions = new PclLoadOptions();
Hello, we just updated to Aspose 23.7 and received the same error. The code is the exact same as yours. For whatever reason, the code works locally, but whenever it is tested in a deployed state we get the same exception on the stack trace as I showed you before.
Please upgrade to 23.8 version. Also, make sure that all fonts are properly installed on the server. If you are using a non-Windows server, you can try installing msttcorefonts package. In case issue still persists, please share the server details with us so that we can further proceed to investigate accordingly.
Hello @asad.ali, thank you for providing a link to 23.8. We switched the version and have code identical to yours. We are still encountering the issue. Are there any other steps we can take for remediation?
Our application is deployed on AWS in a Docker container. Pretty standard build config, on an EC2. The issue still persists across other environments too, yet it works fine locally. Are there any plans to triage this?
Yes, Aspose.PDF for Java can be used in both Windows and Linux like environment. Can you please share your sample docker file that you have for your application?