Aspose Slides Master FollowMasterBackground

Hi,

In old version was the property FollowMasterBackground to turn off master for certain slide. How to do it in version 14?

Hi Alex,

I have observed the requirement shared by you and like to share you can use BackgroundType enumeration in this regard for setting the slide background. Please visit this documentation link for your kind reference in this regard.

Many Thanks,


Thanks, but there is
not quite what I want. I have, for example, in a master page image or page number and would like to hide it by some slide. I can create two master (one with image and one empty), but how can I change the master page by some slide?

Hi Alex,


I have observed the requirements shared by you and have not been able to completely understand them. Can you please share some more information about your requirement. Please also share the sample desired presentation with us that I may have look and try implementing on my end to help you further.

Many Thanks,

Hi,

Here is example:


------------------------------------------
Presentation pp = new Presentation();


// company logo on master
IMasterSlide ss = pp.Masters[0];
IAutoShape sha = ss.Shapes.AddAutoShape(ShapeType.Rectangle, 600, 520, 120, 20);
sha.FillFormat.FillType = FillType.Solid;
sha.FillFormat.SolidFillColor.Color = System.Drawing.Color.Red;
sha.AddTextFrame(“Company logo”);
sha.LineFormat.FillFormat.FillType = FillType.Solid;
sha.LineFormat.FillFormat.SolidFillColor.Color = System.Drawing.Color.Azure;

ISlide slide0 = (ISlide)pp.Slides[0];

// Add new slide, Company Logo Showed
ISlide slide = pp.Slides.AddEmptySlide(slide0.LayoutSlide);
IAutoShape rec = slide.Shapes.AddAutoShape(ShapeType.Rectangle, 200, 200, 200, 200);
rec.FillFormat.FillType = FillType.Solid;
rec.FillFormat.SolidFillColor.Color = System.Drawing.Color.Green;
rec.AddTextFrame(“Hire show Company LOGO”);
rec.LineFormat.FillFormat.FillType = FillType.Solid;
rec.LineFormat.FillFormat.SolidFillColor.Color = System.Drawing.Color.Azure;

///Add new slide
ISlide slide1 = pp.Slides.AddEmptySlide(slide0.LayoutSlide);
/// In this Slide I would like to hide company logo
///???/////////


IAutoShape rec1 = slide1.Shapes.AddAutoShape(ShapeType.Rectangle, 200, 200, 200, 200);
rec1.FillFormat.FillType = FillType.Solid;
rec1.FillFormat.SolidFillColor.Color = System.Drawing.Color.Blue;
rec1.AddTextFrame(“Hier hide Company LOGO”);
rec1.LineFormat.FillFormat.FillType = FillType.Solid;
rec1.LineFormat.FillFormat.SolidFillColor.Color = System.Drawing.Color.Azure;

-------------------------------------------------------------------

Thank you

Hi,

I have tried to use the sample code shared by you and have generated the presentation. Unfortunately, I have not been able to understand the requirement or issue incurring on your end so far. I humbly request you to please share the detailed scenario of you requirement in the form of sample presentation, snapshot and explanation. I will try my best to help you further in this regard afterwards. Can you please also elaborate the following comments as well for reference so that it may help in understanding your requirement.

a.kapitanovskyy@logit-management-consulting.com:

Thanks, but there is
not quite what I want. I have, for example, in a master page image or page number and would like to hide it by some slide. I can create two master (one with image and one empty), but how can I change the master page by some slide?


Now, conceptually, whatever you will add on master slide, it will get available on layout slides. So, when you try to add a normal slide, it will follow some layout slide. When it will follow a layout slide, It will inherit the shapes available in that layout slide and show them in newly added slide.

Many Thanks,

Hello Mudassir,

Excuse me, I try to describe my problem otherwise. I prepare two Master Page :


IMasterSlide master1 = pp.Masters[0];
IMasterSlide
master2 = pp.Masters.AddClone(pp.Masters[0]);


// One Master with company logo left
IAutoShape sha = master1.Shapes.AddAutoShape(ShapeType.Rectangle, 600, 520, 120, 20);
sha.FillFormat.FillType = FillType.Solid;
sha.FillFormat.SolidFillColor.Color = System.Drawing.Color.Red;
sha.AddTextFrame(“Company logo”);
sha.LineFormat.FillFormat.FillType = FillType.Solid;
sha.LineFormat.FillFormat.SolidFillColor.Color = System.Drawing.Color.Azure;


// Another Master with another logo right
IAutoShape sha1 =
master2 .Shapes.AddAutoShape(ShapeType.Rectangle, 0, 500, 120, 20);
sha1.FillFormat.FillType = FillType.Solid;
sha1.FillFormat.SolidFillColor.Color = System.Drawing.Color.Blue;
sha1.AddTextFrame(“
Another logo”);
sha1.LineFormat.FillFormat.FillType = FillType.Solid;
sha1.LineFormat.FillFormat.SolidFillColor.Color = System.Drawing.Color.Azure;

How can I create a new Slide with another MasterPage (master2)?

Thanks

Hi Alex,

I have observed the new sample code shared by you and have worked over following requirement shared by you.

How can I create a new Slide with another MasterPage (master2)?

Please use the following sample code to serve the purpose. Please share, if I may help you in this regard.

public static void TestMasters()
{
Presentation pp=new Presentation();


IMasterSlide master1 = pp.Masters[0];
IMasterSlide master2 = pp.Masters.AddClone(pp.Masters[0]);


// One Master with company logo left
IAutoShape sha = master1.Shapes.AddAutoShape(ShapeType.Rectangle, 600, 520, 120, 20);
sha.FillFormat.FillType = FillType.Solid;
sha.FillFormat.SolidFillColor.Color = System.Drawing.Color.Red;
sha.AddTextFrame(“Company logo”);
sha.LineFormat.FillFormat.FillType = FillType.Solid;
sha.LineFormat.FillFormat.SolidFillColor.Color = System.Drawing.Color.Azure;


// Another Master with another logo right
IAutoShape sha1 = master2 .Shapes.AddAutoShape(ShapeType.Rectangle, 0, 500, 120, 20);
sha1.FillFormat.FillType = FillType.Solid;
sha1.FillFormat.SolidFillColor.Color = System.Drawing.Color.Blue;
sha1.AddTextFrame(“Another logo”);
sha1.LineFormat.FillFormat.FillType = FillType.Solid;

sha1.LineFormat.FillFormat.SolidFillColor.Color = System.Drawing.Color.Azure;


//Adding a slide with first master
pp.Slides.AddEmptySlide(pp.Masters[0].LayoutSlides.GetByType(SlideLayoutType.Blank));

//How can I create a new Slide with another MasterPage (master2)?
//Adding a slide with 2nd master
pp.Slides.AddEmptySlide(pp.Masters[1].LayoutSlides.GetByType(SlideLayoutType.Blank));


pp.Save(“D:\Aspose Data\TestMaster.pptx”, SaveFormat.Pptx);
}

Many Thanks,

Super, Thanks