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

Free Support Forum - aspose.com

Saving Slides as html throws ArrayIndexOutOfBoundsException


Hi,

I am using Aspose slides 15.7.0 and am converting a MS powerpoint slide to html. While aspose works well in most cases, sometimes it throws ArrayIndexOutOfBoundsException. Please see the test file attached. The slide has an image (6 MBs big) as the background image, not sure if the image size is causing the problem. Is there a way I can compress the image in aspose before saving (exporting) it as html. I did try setting the JPEG quality to 30, it didn't help. Any other workaround appreciated.

Presentation pres = new Presentation(file.getPath());
com.aspose.slides.HtmlOptions options = new com.aspose.slides.HtmlOptions();
options.setJpegQuality((byte)30);
pres.save(directoryToZip + "/" + FilenameUtils.getBaseName(file.getFileName()) + ".html", SaveFormat.Html, options);


Caused by: java.lang.ArrayIndexOutOfBoundsException: 612

at com.aspose.slides.ms.core.System.Drawing.imagecodecs.pf4dd765c.pf4dd765c.i$f.do(Unknown Source)

at com.aspose.slides.ms.core.System.Drawing.imagecodecs.pf4dd765c.pf4dd765c.i.do(Unknown Source)

at com.aspose.slides.ms.core.System.Drawing.imagecodecs.pf4dd765c.pf4dd765c.i.do(Unknown Source)

at com.aspose.slides.ms.core.System.Drawing.imagecodecs.pf4dd765c.pf4dd765c.i.try(Unknown Source)


Thanks,

Chinmay

Hi Chinmay,

Thanks for inquiring Aspose.Slides.

I have worked with the presentation file shared by you using Aspose.Slides for Java 16.2.0 on my end and have not been able to observe the issue specified. For your kind reference, I have attached the generated HTML as well and request you to please try using specified version on your end.

Many Thanks,