Hi,
We have a PPTX containing an oddly wide slide. PowerPoint loads and operates on the presentation without issue though. If I clone that slide into a new deck with Aspose.Slides, PowerPoint won’t open the resulting PPTX. The problem may be with the original slide, but Aspose.Slides should at least report an error at some point, not silently save a corrupted PPTX.
The problem can be reproduced with this code and the attached PPTX:
Presentation pres1 = new Presentation("/tmp/CorruptSlide.pptx");
try
{
Presentation pres2 = new Presentation();
pres2.getSlides().addClone(pres1.getSlides().get_Item(1));
pres2.save("/tmp/copy.pptx", SaveFormat.Pptx);
}
catch (Exception ex)
{
System.out.println(ex);
} finally {
if (pres1 != null) pres1.dispose();
}
CorruptSlide.zip (31.6 KB)
@tombriggsallego
It seems you are encountering an issue where cloning a slide from a PPTX file results in a corrupted presentation that cannot be opened in PowerPoint. This problem has been reported by other users as well, and it appears to be related to specific characteristics of the original slide.
In one case, a user faced a similar issue when trying to clone a slide from a presentation that contained only master slides. The resulting PPTX file was corrupted when saved, although it displayed correctly when exported to PDF. The development team acknowledged the issue and created a ticket for it, indicating that they are working on a solution.
To address your problem, here are a few suggestions:
-
Check for Updates: Ensure you are using the latest version of Aspose.Slides. The issue you are experiencing may have been resolved in a newer release. For instance, a fix was implemented in version 22.11, which addressed similar corruption issues.
-
Error Handling: While your code does include a try-catch block, it may be beneficial to add more detailed logging or error handling to capture any specific exceptions that might occur during the cloning process.
-
Test with Different Slides: If possible, try cloning a different slide or a simpler presentation to see if the issue persists. This can help determine if the problem is specific to the original slide’s properties.
-
Contact Support: If the issue continues, consider reaching out to Aspose support with details about your environment (OS version, .NET target platform) and the problematic PPTX file. This information can assist the development team in diagnosing the issue more effectively.
Here is a sample code snippet that demonstrates how to clone a slide within the same presentation, which you can use as a reference:
using Aspose.Slides;
using Aspose.Slides.Export;
Presentation pres1 = new Presentation("/tmp/CorruptSlide.pptx");
try
{
Presentation pres2 = new Presentation();
pres2.Slides.AddClone(pres1.Slides[1]);
pres2.Save("/tmp/copy.pptx", SaveFormat.Pptx);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
finally
{
if (pres1 != null) pres1.Dispose();
}
Make sure to replace the file paths with your actual file locations. If you continue to experience issues, please provide additional details, and I can assist further.
Sources:
[1]: Corrupted PPTX File after Cloning Slides from Another Presentation in C#
@tombriggsallego,
I’ve reproduced the problem you described. We apologize for any inconvenience caused.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): SLIDESJAVA-39638
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.