Work with slide layouts
Overview
Work with the layouts attached to a presentation’s masters. Layouts provide placeholder positions and shared structure for titles, text and pictures. Select a layout for a new slide, copy layouts when needed, or assign a different layout to an existing slide.
A layout supplies the placeholder arrangement used when a slide is created; the slide then owns its entered content. The example creates a new slide from the title layout. The master above the layout supplies shared design, while local slide settings can override inherited values.
Usage example (C# / .NET)
Install Aspose.Slides for .NET before running this standalone example.
This C# example selects the title layout from the first master and creates a slide from it. The resulting slide inherits the layout’s title placeholders and remains associated with that layout in the saved PPTX.
using System;
using Aspose.Slides;
using Aspose.Slides.Export;
using var presentation = new Presentation();
var layout = presentation.Masters[0].LayoutSlides.GetByType(SlideLayoutType.Title);
if (layout != null)
{
presentation.Slides.RemoveAt(0);
var slide = presentation.Slides.AddEmptySlide(layout);
slide.Name = "Title layout example";
presentation.Save("slide-layouts.pptx", SaveFormat.Pptx);
}
else
{
Console.WriteLine("The presentation has no title layout.");
}
FAQ
Why use a layout instead of placing every object manually?
A layout gives related slides a common structure and provides placeholders your application can fill with content.
How do layouts relate to slide masters?
Each layout belongs to a master. The master supplies shared design and theme information, while layouts define the placeholder arrangement used by individual slides.
Can I switch an existing slide to another layout?
Yes. Assign a different layout to the slide. Inspect the resulting placeholders and content afterward, especially if the old and new layouts have different structures.
Guides
Related feature: Work with placeholders.