Aspose Slides for Java version 20.4 introduced an error in Presentation.save()
For one of my presentation files the following code throws an ArrayIndexOutOfBoundsException:
IPresentation presentation = new Presentation("untitled.pptx");
System.out.println("Write to file");
presentation.save("demo.pptx", SaveFormat.Pptx);
System.out.println("Wrote to file");
The Output is:
Write to file
Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 2
at com.aspose.slides.v.do(Unknown Source)
at com.aspose.slides.et.do(Unknown Source)
at com.aspose.slides.et.do(Unknown Source)
at com.aspose.slides.ev.do(Unknown Source)
at com.aspose.slides.e6.for(Unknown Source)
at com.aspose.slides.e6.do(Unknown Source)
at com.aspose.slides.q2.do(Unknown Source)
at com.aspose.slides.q2.do(Unknown Source)
at com.aspose.slides.bg.do(Unknown Source)
at com.aspose.slides.akc.do(Unknown Source)
at com.aspose.slides.afs.do(Unknown Source)
at com.aspose.slides.afs.do(Unknown Source)
at com.aspose.slides.Presentation.do(Unknown Source)
at com.aspose.slides.Presentation.do(Unknown Source)
at com.aspose.slides.Presentation.save(Unknown Source)
at de.demo.App.main(App.java:74)
Process de.demo.App exited abnormally with code 1
With Aspose Slides version 20.3 the output was as expected:
Write to file
Wrote to file
The same is true if the target is an output stream.
I have observed the issue shared by you and request you to please share the source file reproducing the issue on your end along with Java and Operating System details.,
It seems, you do not mean the Java source file above in App.zip when you mention the “source file”.
At the moment it is not possible to send you the .pptx file since we do not own the copyright to it have to clear that issue first.
We need to have source presentation file in order to proceed further with investigation on our end. Without that, unfortunately it will not be possible for us to investigate the issue further.
I have created an issue with ID SLIDESJAVA-38146 in our issue tracking system to further investigate this issue after reproducing on my end. We will share feedback with you as soon as the issue will be fixed.