Spire.Office version: 9.12.0
Java: Amazon-Corretto 11 and 21 all systems multiple minor versions (mac, windows, linux)
Any ODP file (incl. the one attached) ends up in
- Code: Select all
Caused by: com.spire.presentation.packages.sprfpo: Unknown file format.
at com.spire.presentation.packages.sprnym.<init>(Unknown Source)
at com.spire.presentation.packages.sprcxp.spr℉┻(Unknown Source)
at com.spire.presentation.packages.sprcxp.spr⅟┿(Unknown Source)
at com.spire.presentation.packages.sprcxp.<init>(Unknown Source)
at com.spire.presentation.packages.sprcxp.<init>(Unknown Source)
at com.spire.presentation.Presentation.spr▤┾(Unknown Source)
at com.spire.presentation.Presentation.loadFromStream(Unknown Source)
at xx.PresentationConvertor.convertInternal(PresentationConvertor.java:32)
at xxx.AbstractConvertor.convert(AbstractConvertor.java:16)
at xxx.SpireConvertorService.convert(SpireConvertorService.java:33)
... 33 more
Caused by: com.spire.presentation.packages.sprgym: Error reading "styles.xml" xml part
at com.spire.presentation.packages.sprnym.spr⑫┤(Unknown Source)
at com.spire.presentation.packages.sprnym.spr┪┗(Unknown Source)
at com.spire.presentation.packages.sprnym.spr‼(Unknown Source)
... 43 more
Caused by: java.lang.ClassCastException: class java.util.AbstractMap$SimpleEntry cannot be cast to class com.spire.presentation.packages.sprlsja (java.util.AbstractMap$SimpleEntry is in module java.base of loader 'bootstrap'; com.spire.presentation.packages.sprlsja is in unnamed module of loader 'app')
at com.spire.presentation.packages.sprufn.spr╄┝(Unknown Source)
at com.spire.presentation.packages.sprufn.spr┩≇(Unknown Source)
at com.spire.presentation.packages.spralm.spr┩≇(Unknown Source)
at com.spire.presentation.packages.sprodn.spr┩≇(Unknown Source)
at com.spire.presentation.packages.spralm.spr┩≇(Unknown Source)
at com.spire.presentation.packages.spralm.spr┩≇(Unknown Source)
at com.spire.presentation.packages.spralm.spr┩≇(Unknown Source)
at com.spire.presentation.packages.sprqxm.spr┩≇(Unknown Source)
... 46 more
The fail occurs in method loadFromStream in this code:
- Code: Select all
//create a Presentataion instance
Presentation presentation = new Presentation();
//set font path
if (!StringUtils.isEmpty(externalFontPath)) {
presentation.setCustomFontsFolder(externalFontPath);
}
//load the sample PowerPoint file
// !! HERE IT FAILS !!
presentation.loadFromStream(file, FileFormat.AUTO);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
//save to PDF file
presentation.saveToFile(baos, com.spire.presentation.FileFormat.PDF);
presentation.dispose();
return new ByteArrayInputStream(baos.toByteArray());
Is there a workaround?