Manage Presentation Notes in .NET

Overview

Aspose.Slides for .NET lets you remove notes from individual slides or an entire presentation, customize the text style defined in the master notes slide, and remove notes and handout masters. This article shows how to perform these operations and save the updated presentation.

To read or change notes page dimensions, switch orientation, and check export behavior, see Notes Page Size.

Remove Notes from a Slide

To remove notes from a specific slide, use its NotesSlideManager and call RemoveNotesSlide. The example loads a presentation containing at least one slide and removes the notes from the first slide, accessed at index zero. Notes on other slides remain unchanged, and the updated presentation is saved in PPTX format.

using Aspose.Slides;
using Aspose.Slides.Export;

using var presentation = new Presentation("presentation.pptx");

var notesManager = presentation.Slides[0].NotesSlideManager;
notesManager.RemoveNotesSlide();

presentation.Save("presentation_without_first_slide_notes.pptx", SaveFormat.Pptx);

Remove Notes from All Slides

To remove all slide notes, iterate through the presentation’s Slides collection and call RemoveNotesSlide for each slide. This example processes every slide in an existing presentation and saves a PPTX copy without slide notes.

using Aspose.Slides;
using Aspose.Slides.Export;

using var presentation = new Presentation("presentation.pptx");

foreach (var slide in presentation.Slides)
{
    slide.NotesSlideManager.RemoveNotesSlide();
}

presentation.Save("presentation_without_notes.pptx", SaveFormat.Pptx);

Remove Notes and Handout Masters

Notes and handout masters define shared formatting and placeholders for their respective page types. Removing a master is a separate operation from removing an individual slide’s notes with RemoveNotesSlide.

Remove an Unused Notes Master

When cleaning up a template that has no notes pages, you can remove its unused notes master. Access MasterNotesSlideManager, check MasterNotesSlide, and call RemoveMasterNotesSlide.

The following example requires a presentation to contain no notes pages. It removes the notes master if one exists, including its formatting and header/footer placeholders, and saves the template.

using Aspose.Slides;
using Aspose.Slides.Export;

using var presentation = new Presentation("template_without_notes.pptx");

var manager = presentation.MasterNotesSlideManager;
if (manager.MasterNotesSlide != null)
{
    manager.RemoveMasterNotesSlide();
}

presentation.Save("template_without_notes_master.pptx", SaveFormat.Pptx);

After removal, MasterNotesSlide returns null. If the master is already absent, the example skips removal and still saves the presentation.

Remove a Handout Master

To remove a handout master, access MasterHandoutSlideManager, check MasterHandoutSlide, and call RemoveMasterHandoutSlide.

For this example, use a presentation containing slide notes and customized notes and handout masters. Give the handout master a visible banner and header/footer text so that the effect of removal is easy to compare in handout output.

using Aspose.Slides;
using Aspose.Slides.Export;

using var presentation = new Presentation("presentation_with_custom_masters.pptx");

var manager = presentation.MasterHandoutSlideManager;
if (manager.MasterHandoutSlide != null)
{
    manager.RemoveMasterHandoutSlide();
}

presentation.Save("presentation_without_handout_master.pptx", SaveFormat.Pptx);

After removal, MasterHandoutSlide returns null. Existing slide notes and the notes master remain unchanged. If the handout master is already absent, the example simply saves the presentation.

In handout output, the removed master’s banner, formatting, and header, footer, date/time, and page-number placeholders no longer appear. The presentation slides still appear in the handout layout, including any footer or date text on the slides themselves. Slide numbers added by the handout export settings are separate from the master’s page-number placeholder.

If you only want to hide handout headers or footers, change the corresponding placeholder visibility through the handout master’s header/footer manager instead. This keeps the master and its other formatting, such as a custom banner.

Add a Notes Style

The NotesStyle property of IMasterNotesSlide defines the master notes text style. The example accesses the existing MasterNotesSlide and uses GetLevel with index zero to select the first paragraph level. It sets the bullet type to BulletType.Symbol and saves the presentation in PPTX format. The input must contain a master notes slide for the style change to take effect; otherwise, the presentation is saved without changing the notes style.

using Aspose.Slides;
using Aspose.Slides.Export;

using var presentation = new Presentation("presentation.pptx");

var notesMaster = presentation.MasterNotesSlideManager.MasterNotesSlide;
if (notesMaster != null)
{
    var notesStyle = notesMaster.NotesStyle;
    var paragraphFormat = notesStyle.GetLevel(0);
    paragraphFormat.Bullet.Type = BulletType.Symbol;
}

presentation.Save("presentation_with_notes_style.pptx", SaveFormat.Pptx);

FAQ

Which API provides access to the notes of a specific slide?

Use the slide’s NotesSlideManager property. The manager’s NotesSlide property returns the notes slide, or null if the slide has no notes.

Does working with notes require Microsoft PowerPoint to be installed?

No. Aspose.Slides works with notes in PowerPoint and OpenDocument presentations without requiring Microsoft PowerPoint to be installed.