---
title: "PdfEditor"
canonical_url: "https://www.nutrient.io/api/python/editors/pdf-editor/"
md_url: "https://www.nutrient.io/api/python/editors/pdf-editor.md"
last_updated: "2026-06-08T15:25:21.250Z"
description: "Provides specialized editing capabilities for PDF documents. Implements document and page-based editing operations specific to PDF format."
---

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

```python

from nutrient_sdk import PdfEditor

```

## Construction

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

## Class Methods

### edit

```python

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

```

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

**Parameters:**

| Name       | Type                                | Description           |
| ---------- | ----------------------------------- | --------------------- |
| `document` | [`Document`](/api/python/document/) | The document to edit. |

**Returns:** [`PdfEditor`](/api/python/editors/pdf-editor/) - A new PdfEditor instance for editing the document.

---

## Methods

### append_document

```python

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

```

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

**Parameters:**

| Name       | Type                                | Description                                         |
| ---------- | ----------------------------------- | --------------------------------------------------- |
| `document` | [`Document`](/api/python/document/) | The document to append to the current PDF document. |

---

### close

```python

def close(self) -> None

```

Closes the editor and releases all associated resources.

---

### detect_and_add_form_fields

```python

def detect_and_add_form_fields(self) -> None

```

Detects form fields on every page of the document and adds matching interactive form fields to the PDF. Detection uses the Vision form pipeline; detected fields are converted into AcroForm form fields placed at the detected positions.

---

### make_searchable

```python

def make_searchable(self) -> None

```

Runs OCR over every page in the document and writes an invisible, searchable text layer on top of the rendered page content.

---

### save

```python

def save(self) -> None

```

Saves the current changes made in the editor.

---

### save_as

```python

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

```

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

**Parameters:**

| Name   | Type  | Description                                     |
| ------ | ----- | ----------------------------------------------- |
| `path` | `str` | The file path where the document will be saved. |

---

## Properties

### form_field_collection

```python

@property
def form_field_collection(self) -> list

```

The collection of form fields in the PDF document.

**Type:** `list`

*Read-only property.*

---

### metadata

```python

@property
def metadata(self) -> PdfMetadata

```

The metadata associated with the current PDF document.

**Type:** [`PdfMetadata`](/api/python/editors/pdf/pages/pdf-metadata/)

*Read-only property.*

---

### page_collection

```python

@property
def page_collection(self) -> list

```

The collection of pages in the PDF document.

**Type:** `list`

*Read-only property.*

---

## Context manager

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

```python

with PdfEditor.edit(...) as pdf_editor:
    #... use pdf_editor...

    pass  # closed automatically on exit

```

Or close explicitly:

```python

pdf_editor = PdfEditor.edit(...)
try:
    #... use pdf_editor...

    pass
finally:
    pdf_editor.close()

```

---

## Related pages

- [All public classes import directly from the top-level package:](/api/python/editors.md)
- [Word Editor](/api/python/editors/word-editor.md)

