Cloning Slides � Missing Master and Images

I am trying to build a new PowerPoint file using slides from various other PowerPoint files. I am using Aspose.Slides trial version (not sure if it would make a difference). I used the CloneSlide() method and realized that the Master and any images in the original slide were missing from the new PowerPoint. I did notice in the forums that you must use CloneSlide() with a new sorted list to include these items. This did not seem to help. I simplified it as much as possible and was still not able to get these items to transfer with the slide. Below is the simplified code used for the test. Hopefully you will be able tell me what I am doing wrong. Thanks for the help.

Aspose.Slides.Presentation newPPT = new Aspose.Slides.Presentation();
Aspose.Slides.Presentation sourcePPT = new Aspose.Slides.Presentation(Server.MapPath(@"~\test\test.ppt"));

SortedList sList = new SortedList();

Aspose.Slides.Slide newSlide = sourcePPT.GetSlideByPosition(1);

newPPT.CloneSlide(newSlide, newPPT.Slides.LastSlidePosition + 1, newPPT, sList);

This message was posted using Page2Forum (attachment) from Cloning a Slide - Aspose.Slides for .NET and Java

Dear topicomha,

Thanks for considering Aspose.Slides

Actually, you are calling the clone slide method of wrong presentation, the correct syntax of it is like this

sourcePresentation.CloneSlide(sourceSlide, targetPresentation.Slides.LastSlidePosition+1, targetPresentation, new SortedList());

Where sourcePresentation is the presentation, which have a source slide. So your code should be like this

sourcePPT .CloneSlide(newSlide, newPPT.Slides.LastSlidePosition + 1, newPPT, sList);

That seemed to do it. Thank you very much.