This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /api/python/editors/presentation-editor.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. PresentationEditor

Provides specialized editing capabilities for presentation documents. Supports template-based document generation and manipulation of OpenXML PowerPoint documents.

from nutrient_sdk import PresentationEditor

Construction

PresentationEditor cannot be instantiated directly. Obtain instances through static factory methods or via other SDK classes.

Class Methods

edit

@classmethod
def edit(cls, document: Document) -> PresentationEditor

Creates a new PresentationEditor instance and begins editing the specified document.

Parameters:

NameTypeDescription
documentDocumentThe document to edit.

Returns: PresentationEditor - A new PresentationEditor instance for editing the document.


Methods

apply_template_model

def apply_template_model(self, json_template: str) -> None

Applies a template model to the presentation document from a JSON string.

Parameters:

NameTypeDescription
json_templatestrThe JSON string containing the template model data.

close

def close(self) -> None

Closes the current document’s editing context without disposing the editor. The editor remains available for another editing operation.


save

def save(self) -> None

Saves the current changes made in the editor.


save_as

def save_as(self, path: str) -> None

Saves the current changes to a file at the specified path.

Parameters:

NameTypeDescription
pathstrThe file path where the document will be saved.

save_with_model_as

def save_with_model_as(self, path: str) -> None

Saves the presentation document with the applied template model to a file.

Parameters:

NameTypeDescription
pathstrThe file path where the processed document will be saved.

Context manager

PresentationEditor supports the context manager protocol. Use with to ensure native resources are released automatically:

with PresentationEditor.edit(...) as presentation_editor:
# ... use presentation_editor ...
pass # released automatically on exit

Or manage it explicitly. Closing the document and releasing the object are two different operations:

presentation_editor = PresentationEditor.edit(...)
try:
# ... use presentation_editor ...
presentation_editor.close() # close the document; the object stays usable
finally:
presentation_editor.dispose() # close it and release the native handle

close() closes the document currently being edited and leaves this object usable: call edit() again to edit another document. It does not release the native handle.

dispose() ends this object’s life. It closes the document first — that is what hands ownership of a converted document back to the SDK — and then releases the handle. Leaving a with block does the same. Calling it more than once has no effect.

An object that is never disposed has its handle reclaimed when it is garbage collected, but that is a safety net rather than a substitute: it releases the handle without closing the document, and finalization runs at an unpredictable time.