Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.

Wed Feb 12, 2025 8:20 am

Hello, I have a problem with ODP conversion to PDF.
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?

jan.zanda
 
Posts: 30
Joined: Wed Mar 06, 2024 11:30 am

Wed Feb 12, 2025 9:02 am

Hi,

Thanks for your feedback.
I tested your ODP file but didn't encounter the same exception as yours. Please confirm if the filestream you passed to the loadFromStream method here is a correctly formatted ODP file stream. You can directly verify loading the ODP file like below.
Code: Select all
presentation.loadFromFile("data/file_example_ODP_500kB.odp", FileFormat.ODP);

Besides, I will further try the Amazon-Corretto 11 and 21 JDK and give you feedback ASAP.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1379
Joined: Tue Sep 27, 2016 1:06 am

Wed Feb 12, 2025 9:36 am

Yes, sadly, it behaves the same this way. The same exception.

Thanks

Jan

jan.zanda
 
Posts: 30
Joined: Wed Mar 06, 2024 11:30 am

Thu Feb 13, 2025 3:00 am

Hi Jan,

Thanks for your feedback.
I tested your file with the Amazon-Corretto 11 Windows JDK, but still can't reproduce your issue. Here I uploaded my executable jar, please directly use the command: java -jar ClientTest.jar to test on your side. If the issue still occurs, please provide your testing environment, such as Windows 10, 64 bit.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1379
Joined: Tue Sep 27, 2016 1:06 am

Wed Feb 19, 2025 8:08 am

Thank You, it seems to be a dependency conflict, there seems to be a library interfering. We should fix this on our end.

jan.zanda
 
Posts: 30
Joined: Wed Mar 06, 2024 11:30 am

Wed Feb 19, 2025 8:31 am

Hi,

Thansk for your feedback.
If you need assistance in the future, please do not hesitate to contact us.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1379
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.Presentation

cron