Corrupted PPTX File after Cloning Slides from Another Presentation in C#

Hi, I have an issue with the following files:

I have an empty presentation with only master slides and want to clone the one and only slide from another presentation into it.

When I save the file as PPTX and try to open it with PowerPoint it is corrupted. When I export to PDF the file looks correctly.

The code is quite simple:

using (Presentation pres1 = new Presentation(@"emtpy.pptx"),
    pres2 = new Presentation(@"test.pptx"))
{
    foreach (ISlide slide in pres2.Slides)
    {
        pres1.Slides.AddClone(slide);
    }
    try
    {
        pres1.Save(Path.Combine(dir, "out.pptx"), SaveFormat.Pptx);
    }
    catch (Exception ex)
    {
        Console.WriteLine(ex.Message);
    }
}

These are the files: slides.zip (486.6 KB)

@Martek,
Thank you for reporting the issue.

I’ve reproduced the problem with the corrupted presentation and added a ticket with ID SLIDESNET-43462 to our issue tracking system. We apologize for any inconvenience. Our development team will investigate the case. You will be notified when the issue is resolved.

It would be great if you could share the following additional information:

  • OS version on which the code was executed
  • .NET target platform in your app

We will then also test a solution in an environment similar to yours.

Hi Andrey,

I tried it with .NET 6.0 (As console application) and on Windows Server 2022.

@Martek,
Thank you for the additional information. I’ve forwarded it to our developers.

Hi Andrey,
can you tell us, if the issue is already solved or when we can expect an update?

@FloL
The development team is already working on a solution to your problem. According to preliminary data, the issue will be fixed in version 22.10. Thank you for your patience.

The issues you have found earlier (filed as SLIDESNET-43462) have been fixed in Aspose.Slides for .NET 22.11 (ZIP, MSI).
You can check all fixes on the Release Notes page.
You can also find the latest version of our library on the Product Download page.