Sign In  Sign Up Live-Chat

Cloning Slides – Missing Master and Images

Last post 07-03-2008, 4:50 PM by topicomha. 2 replies.
Sort Posts: Previous Next
  •  07-02-2008, 10:52 PM 134139

    Cloning Slides – Missing Master and Images

    Attachment: Present (inaccessible)

    I am trying to build a new PowerPoint file using slides from various other PowerPoint files. I am using Aspose.Slides 2.8.4.0 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);

             

    newPPT.Write(Server.MapPath(@"~\test\output.ppt" ));

     


    This message was posted using Page2Forum (attachment) from Cloning a Slide - Aspose.Slides for .NET and Java
     
  •  07-03-2008, 12:59 AM 134148 in reply to 134139

    Re: Cloning Slides – Missing Master and Images

    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);


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Engineer
    Aspose Tyumen Team
     
  •  07-03-2008, 4:50 PM 134248 in reply to 134148

    Re: Cloning Slides – Missing Master and Images

    That seemed to do it. Thank you very much.

     
View as RSS news feed in XML