Notiz

Zeigt, wie man Notizfolien hinzufügt, liest, entfernt und aktualisiert, indem man Aspose.Slides for Python via .NET verwendet.

Eine Notizfolie hinzufügen

Erstelle eine Notizfolie und weise ihr Text zu.

def add_note():
    with slides.Presentation() as presentation:
        slide = presentation.slides[0]

        notes_slide = slide.notes_slide_manager.add_notes_slide()
        notes_slide.notes_text_frame.text = "My note"

        presentation.save("note.pptx", slides.export.SaveFormat.PPTX)

Auf eine Notizfolie zugreifen

Lese den Text einer vorhandenen Notizfolie.

def access_note():
    with slides.Presentation("note.pptx") as presentation:
        slide = presentation.slides[0]

        notes_slide = slide.notes_slide_manager.notes_slide
        notes = notes_slide.notes_text_frame.text

Eine Notizfolie entfernen

Entferne die mit einer Folie verbundene Notizfolie.

def remove_note():
    with slides.Presentation("note.pptx") as presentation:
        slide = presentation.slides[0]

        # Entferne die Notizfolie.
        slide.notes_slide_manager.remove_notes_slide()

        presentation.save("note_removed.pptx", slides.export.SaveFormat.PPTX)

Notiztext aktualisieren

Ändere den Text einer Notizfolie.

def update_note_text():
    with slides.Presentation("note.pptx") as presentation:
        slide = presentation.slides[0]

        # Notiztext aktualisieren.
        slide.notes_slide_manager.notes_slide.notes_text_frame.text = "Updated"

        presentation.save("note_updated.pptx", slides.export.SaveFormat.PPTX)