I’m not really sure what’s going on, for some reason simply opening and saving a template ppt with aspose causes the output file to have errors while opening. LibreOffice seems to be able to repair the file, but Microsoft 365 gives me the error below
Opening the template file by itself in either LibreOffice or Microsoft 365 gives me no errors.
Originally I thought this might have something to do with some of our custom logic, but after disabling all our custom logic the error keeps happening.
After removing our custom logic, the code boils down to
It seems you are encountering an issue where the output PPTX file generated using Aspose.Slides is not opening correctly in Microsoft 365, while LibreOffice can repair it. This type of problem can sometimes arise due to various reasons, including the version of Aspose.Slides being used or specific content in the template.
Here are a few steps you can take to troubleshoot and potentially resolve the issue:
Update Aspose.Slides: Ensure you are using the latest version of Aspose.Slides. There have been reports of similar issues in earlier versions, and updating to a newer version may resolve the problem.
Check the Template File: Since the template file opens without issues, it might be worth examining its content. Sometimes, specific elements or formatting in the template can cause problems during the save process.
Simplify the Code: You mentioned that you have simplified your code. Ensure that the Presentation object is being properly disposed of after use. Here’s a refined version of your code snippet:
Test with Different Content: If possible, try creating a new simple presentation from scratch and save it using the same code. This can help determine if the issue is related to the specific content of your template.
Share Files for Support: If the problem persists, consider sharing the template and the generated output file with Aspose support for further investigation. They may be able to identify specific issues with the files.
Review Similar Issues: There have been discussions in the community regarding similar errors when opening generated PPTX files. It might be helpful to review those threads for additional insights or solutions.
If you continue to experience issues, please provide more details about the specific error message you receive when trying to open the file, as this can help in diagnosing the problem further.
Feel free to reach out if you have any more questions or need further assistance!
I believe the issue is with the specific content, but it must also be something aspose is doing, otherwise I wouldn’t be able to open the template in Microsoft 365.
I don’t believe I can simplify the code any further, it’s already doing the bare minimum.
@ecodev,
Thank you for contacting free support. We are sorry that you encountered this problem. I need some time to check the issue. I will get back to you as soon as possible.
@ecodev,
Using Aspose.Slides for Java 25.4, I was unable to reproduce the problem you described. Please check the issue carefully and note that in the code example you provided, the presentation file is loaded into the presentation variable, but the save method is called on the slideShow object.
I used the code example below,
Presentation presentation = new Presentation("template.pptx");
presentation.save("output.pptx", SaveFormat.Pptx);
presentation.dispose();
and when opening the output presentation file, no error messages appeared.
Thanks for looking into it @andrey.potapov . I’ll try to see if I can make it happen again. I’m unsure why this started with this template.
One last thing, are there any issues I should keep in mind when running with spring/multi threaded applications? By that I mean having multiple presentations open in different threads, not one presentation open in multiple thread.
@ecodev,
Aspose.Slides lets you work in parallel threads as long as each thread owns its own Presentation instance; you may create, edit, and save separate presentations concurrently with no special synchronization. What must be avoided is handing the same Presentation object—or any child object obtained from it—to more than one thread at the same time, because its internal collections are not synchronized. Stick to the rule “one Presentation per thread” and multithreaded processing will remain reliable.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.