- Code: Select all
Presentation pre = new Presentation(src, FileFormat.AUTO);
that throws this exception
- Code: Select all
java.lang.ClassCastException: class com.spire.presentation.packages.sprNZC cannot be cast to class com.spire.presentation.converter.openxml.PptxBaseXmlElement (com.spire.presentation.packages.sprNZC and com.spire.presentation.converter.openxml.PptxBaseXmlElement are in unnamed module of loader 'app')
at com.spire.presentation.GroupShape.<init>(Unknown Source)
at com.spire.presentation.GroupShape.<init>(Unknown Source)
at com.spire.presentation.ActiveSlide.spr (Unknown Source)
at com.spire.presentation.ActiveSlide.<init>(Unknown Source)
at com.spire.presentation.packages.sprnvb.<init>(Unknown Source)
at com.spire.presentation.packages.sprtVb.spr (Unknown Source)
at com.spire.presentation.packages.sprtVb.spr (Unknown Source)
at com.spire.presentation.packages.sprtVb.spr (Unknown Source)
at com.spire.presentation.packages.sprtVb.<init>(Unknown Source)
at com.spire.presentation.Presentation.loadFromFile(Unknown Source)
at com.spire.presentation.Presentation.<init>(Unknown Source)
I tried to use a specific format, FileFormat.PPTX_2013, but I get same result; I tried with different version of the library, from the latest 3.7.4 backward to 2.11.2 and still get same exception; 2.10.1 seems to work but doesn't "import" the presentation well. Obviously src points to the file I'm trying to import, and that file is correctly opened with PowerPoint. If I open the file with PowerPoint and save it without make any correction, after that the file is correclty imported.
This behaviour doesn't happen with all presentations, but it occours with a specific file which is the result of a conversion from a pdf; since it contains sensitive information I'd like to share with you in a private way and not directly in the forum, is it possible?
Thank you
Paolo