Cloning 6MB Slide deck results in 55MB slide deck

Here is the code I am using to clone the deck. I tried saving to a file instead of stream and got the same result. Doesn't happen on all decks. Also tried cloning without saving notes and the same thing happen. Also tried compressing the PPT before trying to clone and still ended up with 57MB final eresult. Try it on attached file.

After cloning the 6MB PPT results in a 57MB file.

Hi,

Thanks and Regards,

Thanks for using Aspose.Slides.

I have been able to verify your specified issue. An issue with issue ID 14578 has been created on our Issue Tracking System to fix the problem. This thread has been associated with this issue, so that you can be automatically notified as soon as this issue is resolved

We are sorry for inconvenience.

Hello,

Thank you for posting this presentation and code example.

When I tested your code I got presentation with size 116MB. Actually, that is correct behavior for this presentation and the code you provided. Master slide in this ppt file contains embedded hidden OLE object (I think presentation simply broken) with size about 3MB. In your code you clone each slide with separate copy of slide’s master so this OLE object will be cloned 40 times.

Unfortunately, such hidden OLE objects can’t be deleted because they don’t have shape associated with it. Possible solution is use the same master slide for all cloned slides. Your code should be changed in this way:

SortedList temp = new SortedList();

for (int sCtr = 1; sCtr <= pres1.Slides.LastSlidePosition; sCtr++)
{
Slide sSlide = pres1.GetSlideByPosition(sCtr);
pres1.CloneSlide(sSlide, pres2.Slides.LastSlidePosition + 1, pres2, temp);
}

Don’t forget that unique “SortedList temp” should be used for every source/target presentations pair.

Thanks - that did the trick. How did you detect that there was a hidden OLE object in the master?

That is rare but standard PowerPoint problem. In theory it can be added by some third party PowerPoint add-ons or may be happens just because of bug in PowerPoint. Such OLE objects are visible by parsing internal PPT structure only.

Hi All,

An article explaining this issue based on the discussion in this thread has been added in our online documentation at the following URL:

http://www.aspose.com/documentation/.net-components/aspose.slides-for-.net/presentations-with-huge-size-after-cloning.html

Best Regards