Provides specialized editing capabilities for PDF documents. Implements document and page-based editing operations specific to PDF format.

from nutrient import PdfEditor

Class Methods

edit

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

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

Parameters:

NameTypeDescription
documentDocumentThe document to edit.

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


Methods

append_document

def append_document(self, document: Document) -> None

Appends all pages from another document to the end of the current PDF document.

Parameters:

NameTypeDescription
documentDocumentThe document to append to the current PDF document.

close

def close(self) -> None

Closes the editor and releases all associated resources.


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.

Properties

form_field_collection

@property
def form_field_collection(self) -> list

Gets the collection of form fields in the PDF document.

Type: list

Read-only property.


metadata

@property
def metadata(self) -> PdfMetadata

Gets the metadata associated with the current PDF document.

Type: PdfMetadata

Read-only property.


page_collection

@property
def page_collection(self) -> list

Gets the collection of pages in the PDF document.

Type: list

Read-only property.