We have found that a specific PDF we use for testing no longer works on the Ubuntu flavour of Linux.
In October 2022, we started using the test PDF with Aspose PDF 19.3 with Adopt OpenJDK 11.08 and the test passed, producing valid powerpoint output. I am not sure what the version of Ubuntu was at that time.
Since then we have updated the version of ubuntu to 20.01 and the version of the JDK to Eclipse Temurin 11.20 and see the same result. I have also reproduced the issue on Ubuntu 22.04 using the latest Eclipse Temurin. I have also tried with and without the jdk16 classifier and both have the same problem.
The code I am using to reproduce the issue is trivial:
License LICENSE = new License();
LICENSE.setLicense(new ByteArrayInputStream(Files.readAllBytes(Path.of("Aspose.Pdf.lic"))));
byte[] pdfBytes = Files.readAllBytes(Path.of(args[0]));
FileOutputStream outputStream = new FileOutputStream(args[1]);
Document document = new Document(new ByteArrayInputStream(pdfBytes));
document.save(outputStream, SaveFormat.Pptx);
And the following command to run it:
java -cp "aspose-pdf-24.1-jdk16.jar" com.test.PPTTestApplication testPDF.pdf testPDF.pptx
I get the following stack trace:
Exception in thread "main" java.lang.NullPointerException
at com.aspose.pdf.internal.l22h.lb.lI(Unknown Source)
at com.aspose.pdf.internal.l22h.lc.lI(Unknown Source)
at com.aspose.pdf.internal.l22h.lj.lI(Unknown Source)
at com.aspose.pdf.internal.l22l.lt.lI(Unknown Source)
at com.aspose.pdf.internal.l93t.lj.lf(Unknown Source)
at com.aspose.pdf.internal.l93t.lj.lI(Unknown Source)
at com.aspose.pdf.internal.l93t.l0if.lI(Unknown Source)
at com.aspose.pdf.internal.l93t.lv.lI(Unknown Source)
at com.aspose.pdf.internal.l93v.lc.lI(Unknown Source)
at com.aspose.pdf.internal.l93t.lv.lI(Unknown Source)
at com.aspose.pdf.internal.l93v.lh.lI(Unknown Source)
at com.aspose.pdf.internal.l93t.lv.lI(Unknown Source)
at com.aspose.pdf.internal.l93v.ly.lI(Unknown Source)
at com.aspose.pdf.internal.l93t.lv.lI(Unknown Source)
at com.aspose.pdf.internal.l93v.le.lI(Unknown Source)
at com.aspose.pdf.internal.l93t.lv.lI(Unknown Source)
at com.aspose.pdf.internal.l93v.lf.lI(Unknown Source)
at com.aspose.pdf.internal.l93t.lk.lI(Unknown Source)
at com.aspose.pdf.internal.l93t.le.lI(Unknown Source)
at com.aspose.pdf.l15l.lI(Unknown Source)
at com.aspose.pdf.l15l.lI(Unknown Source)
at com.aspose.pdf.ADocument.lj(Unknown Source)
at com.aspose.pdf.ADocument.lf(Unknown Source)
at com.aspose.pdf.ADocument.lI(Unknown Source)
at com.aspose.pdf.Document.lI(Unknown Source)
at com.aspose.pdf.ADocument.save(Unknown Source)
at com.aspose.pdf.Document.save(Unknown Source)
at com.test.PPTTestApplication.main(PPTTestApplication.java:24)
Where line 24 is the call to document.save in the code example above.
This issue does not occur on Windows for the same file, using the same JDK.
This issue does not occur with other PDFs that I have tested with, but without knowing the reason behind the issue, it remains a concern.
I have attached the PDF in question.
testPDF.pdf (70.0 KB)
I feel like I could probably diagnose the issue myself if I was able to de-obfuscate the code or add in my own logging to the classes (which I can’t due to the signed nature of the Jar). Please let me know if there is anything else I can do to diagnose the issue further.
EDIT:
I have seen that there is now a 24.2 library that is available. The same issue still occurs in that release, with the following stack trace:
Exception in thread "main" java.lang.NullPointerException
at com.aspose.pdf.internal.l22k.lb.lI(Unknown Source)
at com.aspose.pdf.internal.l22k.lc.lI(Unknown Source)
at com.aspose.pdf.internal.l22k.lj.lI(Unknown Source)
at com.aspose.pdf.internal.l22p.lt.lI(Unknown Source)
at com.aspose.pdf.internal.l93u.lj.lf(Unknown Source)
at com.aspose.pdf.internal.l93u.lj.lI(Unknown Source)
at com.aspose.pdf.internal.l93u.l0if.lI(Unknown Source)
at com.aspose.pdf.internal.l93u.lv.lI(Unknown Source)
at com.aspose.pdf.internal.l93j.lc.lI(Unknown Source)
at com.aspose.pdf.internal.l93u.lv.lI(Unknown Source)
at com.aspose.pdf.internal.l93j.lh.lI(Unknown Source)
at com.aspose.pdf.internal.l93u.lv.lI(Unknown Source)
at com.aspose.pdf.internal.l93j.ly.lI(Unknown Source)
at com.aspose.pdf.internal.l93u.lv.lI(Unknown Source)
at com.aspose.pdf.internal.l93j.le.lI(Unknown Source)
at com.aspose.pdf.internal.l93u.lv.lI(Unknown Source)
at com.aspose.pdf.internal.l93j.lf.lI(Unknown Source)
at com.aspose.pdf.internal.l93u.lk.lI(Unknown Source)
at com.aspose.pdf.internal.l93u.le.lI(Unknown Source)
at com.aspose.pdf.l15l.lI(Unknown Source)
at com.aspose.pdf.l15l.lI(Unknown Source)
at com.aspose.pdf.ADocument.lj(Unknown Source)
at com.aspose.pdf.ADocument.lf(Unknown Source)
at com.aspose.pdf.ADocument.lI(Unknown Source)
at com.aspose.pdf.Document.lI(Unknown Source)
at com.aspose.pdf.ADocument.save(Unknown Source)
at com.aspose.pdf.Document.save(Unknown Source)
at com.test.PPTTestApplication.main(PPTTestApplication.java:24)