Exception "Index out of range" when saving PPTX (C# .NET)

Hi Aspose team,

I’ve encountered similar issue to one you’ve fixed two years ago (PPT - Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index).

Please find example app attached:
ExceptionOnSavePresentation.zip (6.1 MB)

Could you please investigate what is causing this?

Thanks,
Mateusz

@acturisaspose,

I have worked with the sample project shared by you and have been able to observe the issue. An issue with ID SLIDESNET-41131 has been created in our issue tracking system to further investigate and resolve the issue. We will share good news with you soon.

Thanks you for logging this up.

Could you share the details what is causing this issue? I suppose that this is just some edge-case content of presentation that is troublesome, so I could ask my testers to avoid it for now.

Thanks,
Mateusz

@acturisaspose,

I regret to share that at present we may not share any internal details about cause of issue. This issue has just recently been added in our issue tracking system and is pending for investigation. We request for your patience till the time the issue gets resolved.

@acturisaspose,

Can you please try to use following sample code on your end and if there is still an issue than please share feedback with us.

var presentation = new Presentation(path + "Document System Overview.pps");
Presentation destinationPresentation = new Presentation();
foreach (Slide presentationSlide in presentation.Slides)
{
     destinationPresentation.Slides.InsertClone(destinationPresentation.Slides.Count, presentationSlide);
}
destinationPresentation.Slides.RemoveAt(0); //removes empty first slide
using (MemoryStream stream = new MemoryStream())
{
     destinationPresentation.Save(stream, Aspose.Slides.Export.SaveFormat.Pdf);
}

Hi Adnan,

I’ve tested this for attached example and it seems to be fine. I’ll now pass it through our QA team and will let you know if there will be any issues wit that.

Could you please confirm that the defect will still be worked on so at some point we should be able to remove this workaround?

Thanks,
Mateusz

@acturisaspose,

Actually, previously you have been using old API which is no longer supported. Therefore, we suggested you sample code based on latest available Aspose.Slides for .NET 19.7. If you encounter any issue, please feel free to share with us and we will be glad to resolve. Please note that this is not a workaround.