Free Support Forum - aspose.com

Conversion doesn't work for some pptx files

{“message”:"class com.aspose.slides.PptxReadException: String index out of range: 0 —> class com.aspose.slides.ms.pbdb106a0.bq\ncom.aspose.slides.bfu.do(Unknown

@yuriib,

We need sample code snippet along with input file to reproduce the issue at your end. Please share the sample code snippet and problematic input file along with details of Aspose.Slides for Java version that you are using at your end. We will look into it and update you about our findings.

@yuriib,

I have observed the issue shared by you and suggest you to please try using Aspose.Slides for Java 17.12 on your end. If there is still an issue then please share the source presentation, used sample code, Java and Operating System details on your end.

I’ve tried to use 17.12 Aspose.Slides jar lib… That has not helped. The same. OS: Ubuntu 16.04 (or newer version)…

Java : 8th version

@yuriib,

As requested earlier, please share the following information.

final IPresentation presentation = new Presentation(inputStream); final int pageCount = presentation.getSlides().size();

If I resave the same file using Libre Office and send it for conversion … Everything works fine

Could it be the reason that something not saved by MS Office in metadata of that pptx is absent and causes crash?

Does ASPOSE work with Chinese characters (not latin or cyrylic etc) ? I mean … does it support https://en.wikipedia.org/wiki/Chinese_characters ? On the other hand in case of some another pptx files using with such characters everything works fine …

Hello,
Let me contribute a bit to fill up the bug report:

  • What we use: com.aspose:aspose-slides:17.4:jdk16
  • A oneliner that causes the crash: new Presentation(inputStream)
  • We don’t know what software was used to generate the PPTX.
  • We cannot provide the actual PPTX due to sensitive information it has, but, what, I do believe, causes the crash is that the PPTX has something wrong in ./ppt/slideMasters/slideMaster1.xml: /p:sldMaster/p:txStyles/p:bodyStyle/a:lvl###pPr/a:buChar/@char (### is any digit) is empty (simply ""). If we modify the char tag with, say, "*", it seems to work fine.

@yuriib,

Its good to know things are fine on your end.

We may not be able to share any comment in this regard unless we have source presentation and sample code used on your end to verify the issue in our environment.

Aspose.Slides support UTF8 characters set and does work well with Chinese characters if used Chinese fonts are installed on your machine.

@user33,

We suggest you to please first try using latest Aspose.Slides for Java 17.12.1 on your end first. If there is still an issue then please share the source presentation, used sample code, Operating System and Java details with us.

I’ve just changed it in pom.xml to the version you’re suggesting, and it still fails:

Exception in thread "main" class com.aspose.slides.PptxReadException: String index out of range: 0 ---> java.lang.StringIndexOutOfBoundsException: String index out of range: 0
   --- End of inner exception stack trace ---
com.aspose.slides.z8.do(Unknown Source)
com.aspose.slides.Presentation.int(Unknown Source)
com.aspose.slides.Presentation.if(Unknown Source)
com.aspose.slides.Presentation.do(Unknown Source)
com.aspose.slides.Presentation.<init>(Unknown Source)
com.aspose.slides.Presentation.<init>(Unknown Source)
Test.main(Test.java:17)

emptyABuChar.zip (46.5 KB)

Guys, please, I have described the issue reason above: the bad presentation contains ./ppt/slideMasters/slideMaster1.xml with an empty a:buChar attribute, therefore the PPTX parser fails. I’m uploading a ZIP archive containing good and bad case. The difference is that the bad case has a bullet character removed in ./ppt/slideMasters/slideMaster1.xml.

Thanks.

@user33,

I have worked with presentation file TEST-BAD.pptx using Aspose.Slides for Java 18.1 on my end. I have been able to observe the issue shared and an issue with ID SLIDESJAVA-36899 has been created in our issue tracking system to investigate and resolve the issue .This thread has been linked with the issue so that you may be automatically notified once the issue will be fixed.

1 Like

Your efforts are highly appreciated! Thank you very much!

The issues you have found earlier (filed as SLIDESJAVA-36899) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by mudassir.fayyaz