Slide — Aspose.Slides FOSS for .NET API Reference

The Slide class represents a single slide in a presentation. It inherits layout and shape management from BaseSlide and adds slide-specific features such as slide number, visibility, layout reference, notes, and comments.

Package: Aspose.Slides.Foss (net9.0)

using Aspose.Slides.Foss;
public class Slide : BaseSlide, ISlide

Inheritance

BaseSlideSlide


Properties

PropertyTypeAccessDescription
SlideNumberintRead1-based slide number in the presentation.
HiddenboolReadWhether the slide is hidden during a slide show.
NamestringReadName of the slide.
LayoutSlideILayoutSlide?ReadLayout slide applied to this slide.
NotesSlideManagerINotesSlideManagerReadManager for accessing or creating the notes slide.
ShapesIShapeCollection?ReadCollection of shapes on this slide (inherited from BaseSlide).
PresentationIPresentation?ReadParent presentation (inherited from BaseSlide).
SlideIdintReadUnique identifier for the slide (inherited from BaseSlide).

Methods

GetSlideComments(ICommentAuthor?)

Return all comments on this slide, optionally filtered by author.

ParameterTypeDescription
authorICommentAuthor?Filter by author, or null for all comments.

Returns: IComment[]

Remove()

Remove this slide from the presentation.

slide.Remove();

Usage Examples

Access Slide Properties

using Aspose.Slides.Foss;

using var prs = new Presentation("deck.pptx");
foreach (var slide in prs.Slides)
{
    Console.WriteLine($"Slide {slide.SlideNumber}: {slide.Shapes.Count} shapes");
    Console.WriteLine($"  Layout: {slide.LayoutSlide?.LayoutType}");
    Console.WriteLine($"  Hidden: {slide.Hidden}");
}

Work with Notes

using Aspose.Slides.Foss;

using var prs = new Presentation("deck.pptx");
var slide = prs.Slides[0];

// Add notes to a slide
var notesSlide = slide.NotesSlideManager.AddNotesSlide();
notesSlide.NotesTextFrame.Text = "Speaker notes here";

See Also