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
| Property | Type | Access | Description |
|---|---|---|---|
notes_slide | NotesSlide or None | Read | Returns the existing NotesSlide for this slide, or None if no notes slide has been created yet. |
Methods
| Method | Signature | Description |
|---|---|---|
add_notes_slide | add_notes_slide() -> NotesSlide | Create a new notes slide for this slide and return it. If one already exists the existing object is returned. |
remove_notes_slide | remove_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
| Property | Type | Access | Description |
|---|---|---|---|
notes_text_frame | TextFrame or None | Read | The TextFrame that holds the notes body text. Returns None if the notes slide contains no text body element. |
header_footer_manager | NotesSlideHeaderFooterManager | Read | Manages header and footer placeholders on the notes page. |
parent_slide | ISlide | Read | The Slide that owns this notes page. |
Inherited from BaseSlide
| Property | Type | Description |
|---|---|---|
shapes | ShapeCollection | All shapes on the notes page, including the notes body placeholder. |
background | IBackground | Slide background. |
name | str | Internal 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}")