Skip to main content
All docs
V25.1
  • Organize Slide Notes and Notes Layout with DevExpress Presentation API Library

    • 5 minutes to read

    The DevExpress Presentation API library allows you to add, edit, and remove slide notes. Notes are visible to the presenter only. You can also customize the Notes Page layout and print slides with their notes, headers, and footers.

    headers and footers notes page

    You can specify shared visual parameters for all notes or change settings for individual notes. You can also specify headers and footers for the Notes Page layout.

    Important

    The DevExpress Presentation API Library is currently available as a Community Technology Preview (CTP). Note that we do not recommend that you integrate pre-release libraries into mission-critical software applications. You can try the library and share your feedback so that we can make necessary adjustments before the official release. To start a conversation, submit a ticket via the DevExpress Support Center — we’d love to hear from you.

    Create Slide Notes

    Create Notes Master

    Create a Notes Master (note master layout) to enable notes in a presentation. The NotesMaster object is a shared layout that contains visual parameters (location on a slide, text format settings, background, and so on) for headers, footers, and notes in the Notes Page view.

    headers and footers notes master

    The following code snippet creates a new note master layout with default settings (includes note and slide number placeholders):

    using DevExpress.Docs.Presentation;
    //...
    
    using (var presentation = new Presentation(File.ReadAllBytes(@"C:\Documents\Presentation.pptx"))) {
        if (presentation.NotesMaster == null) {
            presentation.NotesMaster = new NotesMaster(name: "notesMaster");
        }
    }
    

    Add a Note

    Create a new NotesSlide object and set it as the Slide.Notes property value. Use the NotesSlide.TextArea.Text property to specify note text.

    The new note inherits its visual parameters from the Presentation.NotesMaster object.

    The following code snippet adds a note to the first slide:

    presentation api added note

    using DevExpress.Docs.Presentation;
    //...
    
    using (var presentation = new Presentation(File.ReadAllBytes(@"C:\Documents\Presentation.pptx"))) {
        Slide slide = presentation.Slides[0];
        slide.Notes = new NotesSlide(presentation.NotesMaster);
        slide.Notes.TextArea.Text = "test note";
    }
    

    Configure Notes

    Edit Note Master Layout

    The Presentation.NotesMaster property obtains note master layout. The following properties obtain placeholder shapes:

    You can change the text formatting, shape settings, and background of all elements that use this Notes Master.

    Note

    A shape’s default character formatting settings may not produce consistent results across different presentation viewers. To ensure consistent appearance, specify character formatting settings explicitly in code.

    The following code snippet changes note master layout settings:

    using DevExpress.Docs;
    using DevExpress.Docs.Presentation;
    using System.Drawing;
    //...
    
    using (var presentation = new Presentation(File.ReadAllBytes (@"C:\Documents\Presentation.pptx")))
    {
        var notesMaster = presentation.NotesMaster;
    
        // Specify header, footer, and date and time:
        notesMaster.ActualHeaderPlaceholder.TextArea.Text = "DevExpress Test Presentation";
        notesMaster.ActualFooterPlaceholder.TextArea.Text = "Created by DevExpress Presentation API";
        notesMaster.ActualDateTimePlaceholder.TextArea.Text = DateTime.Now.ToString();
    
        // Change notes master background:
        SolidFill fill = new SolidFill(Color.LightCyan);
        notesMaster.Background = new CustomSlideBackground(fill);
    
        // Change default text formatting settings:
        ParagraphProperties pp = new ParagraphProperties();
        pp.TextProperties = new TextProperties() { HighlightColor = new OfficeColor(Color.Red) };
        notesMaster.TextStyle.ParagraphProperties = pp;
        notesMaster.TextStyle.Level1ParagraphProperties = pp;
    
        presentation.SaveDocument(new FileStream("C://Documents//presentation-updated.pptx", FileMode.OpenOrCreate, FileAccess.ReadWrite));
    }
    

    Edit Individual Notes

    The Slide.Notes property allows you to obtain slide notes. The following settings are available:

    NotesSlide.TextArea.TextProperties
    Gets or sets text formatting settings.
    TextArea.Text
    Gets or sets the note text.
    ActualNotesPlaceholder
    Obtains the note placeholder shape.

    The following code snippet obtains and changes note settings:

    using DevExpress.Docs;
    using DevExpress.Docs.Presentation;
    using System.Drawing;
    //...
    
    using (var presentation = new Presentation(File.ReadAllBytes(@"C:\Documents\Presentation.pptx"))) {
        Slide slide = presentation.Slides[0]; 
    
        var note = slide.Notes;
        note.TextArea.Text = "updated text";
    
        // Create paragraph properties
        ParagraphProperties textParagraphProperties = new ParagraphProperties() {
            TextProperties = new TextProperties() { HighlightColor = new OfficeColor(Color.Red) }
        };
    
        // Apply text properties to the note
        note.TextArea.ParagraphProperties = textParagraphProperties;
        note.TextArea.Level1ParagraphProperties = textParagraphProperties;
    
        presentation.SaveDocument(new FileStream("C://Documents//presentation_updated.pptx", FileMode.OpenOrCreate, FileAccess.ReadWrite));
    }
    

    Remove Notes

    Check whether the slide contains notes and set the Slide.Notes property to null to remove a note.

    The following code snippet removes all notes:

    using DevExpress.Docs.Presentation;
    
    //...
    using (var presentation = new Presentation(File.ReadAllBytes(@"C:\Documents\presentation.pptx")))
    {
    
        foreach (var note in presentation.Slides.Where(i => i.Notes != null).ToList())
        {
            int index = presentation.Slides.IndexOf(note);
            presentation.Slides[index].Notes = null;
        }
    
        presentation.SaveDocument(new FileStream("C:\\Documents\\PresentationNoNotes.pptx", FileMode.OpenOrCreate, FileAccess.ReadWrite));
    }