I downloaded and installed version 6.3.0 of aspose.slides and all of the slides that I generate have "Click to add title" and "Click to add subtitle" text boxes on them. Version 6.2.0 didn't have these two textboxes. What can I do to stop this or how do I find them to remove them?
I can remove the shapes by looping thru and removing all shapes but the text stays behind.
// Set the master slide
masterSlideEx = presentationEx.Masters[0];
for (int i = 0; i < masterSlideEx.Shapes.Count; i++)
{
masterSlideEx.Shapes.RemoveAt(0);
}
I'm sure this has something to do with SlideLayoutTypeEx so how do I set the SlideLayoutTypeEx to Blank?
Hi David,
I have tried observe the issue shared by you. Can you please share the sample code that you have used for generation of the presentation. Please also share the generated presentation for reference as well. I also like to share that there is also a property SlideLayoutTypeEx.Blank that you may try on your end.
Many Thanks,
Could you give me an example of how to use the SlideLayoutTypeEx?
When I try to set this it tells me the property cannot be set that it is readonly.
PresentationEx presentationEx = new PresentationEx()
SlideEx slideEx = presentationEx.Slides[0];
slideEx.LayoutSlide.LayoutType = SlideLayoutTypeEx.Blank Tells me readonly.
Hi David,
Yes you are right that LayoutType is read only property and only gives layout type. Please use the following code snippet to add slides in presentation using different layouts. In the end of code snippet, I have also shared how to change the layout slide of any given slide. Please share, if you need any further help in this regard.
public static void AddSlideWithLayout()
String path = @“C:\Users\Mudassir\Downloads”;
PresentationEx pres = new PresentationEx();
foreach (LayoutSlideEx layout in pres.LayoutSlides)
pres.Slides.AddEmptySlide(layout);
//Changing the layout slide of presentation
pres.Slides[0].LayoutSlide = pres.LayoutSlides[4];
pres.Write(path + “TesLayout.pptx”);
Many Thanks,
What I'd like to do is to get all of the layout slides in a collection, loop thru them, and return the index of the one that is SlideLayoutTypeEx.Blank. Otherwise setting that with a number works as long as PowerPoint 2007 always has the blank as the 8th one. Something like this:
foreach (LayoutSlideEx layoutSlideEx in presentionEx.LayoutSlides)
{
if (layoutSlideEx.LayOutType == SlideTypeEx.Blank
{
slideEx.LayoutSlide = presentationEx.LayoutSlides[layoutSlideEx.LayOutType]
}
}
Hi David,
Please use the following code snippet for your convenience.
public static void AddSlideWithLayout()
String path = @“C:\Users\Mudassir\Downloads”;
PresentationEx pres = new PresentationEx();
for(;index<pres.LayoutSlides.Count;index++)
layout = pres.LayoutSlides[index];
if (layout.LayoutType == SlideLayoutTypeEx.Blank)
//Changing the layout slide of presentation
pres.Slides.AddEmptySlide(pres.LayoutSlides[index]);
pres.Write(path + “TesLayout.pptx”);
Many Thanks,