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, ISlideInheritance
BaseSlide → Slide
Properties
| Property | Type | Access | Description |
|---|---|---|---|
SlideNumber | int | Read | 1-based slide number in the presentation. |
Hidden | bool | Read | Whether the slide is hidden during a slide show. |
Name | string | Read | Name of the slide. |
LayoutSlide | ILayoutSlide? | Read | Layout slide applied to this slide. |
NotesSlideManager | INotesSlideManager | Read | Manager for accessing or creating the notes slide. |
Shapes | IShapeCollection? | Read | Collection of shapes on this slide (inherited from BaseSlide). |
Presentation | IPresentation? | Read | Parent presentation (inherited from BaseSlide). |
SlideId | int | Read | Unique identifier for the slide (inherited from BaseSlide). |
Methods
GetSlideComments(ICommentAuthor?)
Return all comments on this slide, optionally filtered by author.
| Parameter | Type | Description |
|---|---|---|
author | ICommentAuthor? | 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";