Sign In  Sign Up Live-Chat

Problem with too many master slides on destination presentation

Last post 09-06-2008, 5:38 AM by NKuzmin. 3 replies.
Sort Posts: Previous Next
  •  08-29-2008, 3:26 PM 141809

    Problem with too many master slides on destination presentation

    I have a project where I am cloning multiple slides into one presentation.  On the destination presentation there are multiple masters that are exactly the same.  How do I get rid of the duplicates?
     
  •  08-31-2008, 1:23 PM 141863 in reply to 141809

    Re: Problem with too many master slides on destination presentation

    Dear Daniel,

     

    Thanks for considering Aspose.Slides.

     

    Master slides are really small and don’t contribute considerably in presentation size.

     

    Anyway, you can get rid of by changing the masters of your newly cloned slides. Aspose.Slides provides Slide.ChangeMaster() method which takes parameter of master slide.

     

    Suppose, you want to change master of slide2 same as that of slide1. Your code will look something like this

     

    Slide slide1Master=presentation.GetSlideById(slide1.MasterId);

    slide2.ChangeMaster(slide1Master);

     

    Once, you change the master of all slides to some single master, you can delete all unused Masters using Presentation.DeleteUnusedMasters() method.


    Many Thanks and Kind Regards,

    Shakeel Faiz
    Support Engineer
    Aspose Tyumen Team
     
  •  09-05-2008, 3:43 PM 142672 in reply to 141863

    Re: Problem with too many master slides on destination presentation

    Ok, I understand that, but the problem is that I have 250 slides in my generated presentation and each one has a different master slide. The source files have probably 5 or 6 different master slides all together, but each slide in the generated one has it's own master. Is there any way to tell in code if the master slides are the same?
     
  •  09-06-2008, 5:38 AM 142713 in reply to 142672

    Re: Problem with too many master slides on destination presentation

    Dear Daniel,
    Aspose.Slides tries to minimize a number of cloned masters, but it needs caller's cooperation. Please check the "idList" parameter of the CloneSlide method, it stores information about already cloned masters. If you will pass the same sortedlist for every source and target presentation pair, there will be much lesser unnecessary masters.

    Nikolay Kuzmin
    Developer
    Aspose Tyumen Team
    About Us
    Contact Us
     
View as RSS news feed in XML