NotesSlide, NotesSlideManager — Aspose.Slides FOSS for Python API Reference

Speaker notes in Aspose.Slides FOSS are managed through NotesSlideManager, which is accessible on every Slide. The manager creates or retrieves the NotesSlide that holds the notes text.

Package: aspose.slides_foss


NotesSlideManager

Access via slide.notes_slide_manager.

Properties

PropertyTypeAccessDescription
notes_slideNotesSlide or NoneReadReturns the existing NotesSlide for this slide, or None if no notes slide has been created yet.

Methods

MethodSignatureDescription
add_notes_slideadd_notes_slide() -> NotesSlideCreate a new notes slide for this slide and return it. If one already exists the existing object is returned.
remove_notes_slideremove_notes_slide()Remove the notes slide from this slide.

NotesSlide

Represents the notes page for a slide. NotesSlide extends BaseSlide, so it exposes a shapes collection and a background in addition to the notes-specific members below.

Properties

PropertyTypeAccessDescription
notes_text_frameTextFrame or NoneReadThe TextFrame that holds the notes body text. Returns None if the notes slide contains no text body element.
header_footer_managerNotesSlideHeaderFooterManagerReadManages header and footer placeholders on the notes page.
parent_slideISlideReadThe Slide that owns this notes page.

Inherited from BaseSlide

PropertyTypeDescription
shapesShapeCollectionAll shapes on the notes page, including the notes body placeholder.
backgroundIBackgroundSlide background.
namestrInternal name of the notes slide part.

Usage Example

Add and read speaker notes

import aspose.slides_foss as slides
from aspose.slides_foss import ShapeType, NullableBool
from aspose.slides_foss.export import SaveFormat

with slides.Presentation() as prs:
    slide = prs.slides[0]

    # Add a title shape
    shape = slide.shapes.add_auto_shape(ShapeType.RECTANGLE, 50, 50, 600, 100)
    shape.add_text_frame("Quarterly Results")

    # Create notes and set text
    notes = slide.notes_slide_manager.add_notes_slide()
    if notes.notes_text_frame is not None:
        notes.notes_text_frame.text = (
            "This slide summarises Q3 revenue. "
            "Highlight the 12% YoY growth figure during the presentation."
        )

    prs.save("notes-demo.pptx", SaveFormat.PPTX)


# Reading notes back from an existing file
with slides.Presentation("notes-demo.pptx") as prs:
    for i, slide in enumerate(prs.slides):
        mgr = slide.notes_slide_manager
        if mgr.notes_slide is not None:
            tf = mgr.notes_slide.notes_text_frame
            if tf is not None:
                print(f"Slide {i + 1} notes: {tf.text}")

See Also