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

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

using Nutrient;

The SDK creates this class through factory methods or other SDK objects.

Properties

FormFieldCollection

public PdfFormFieldCollection FormFieldCollection { get; }

The collection of form fields in the PDF document.

Type: PdfFormFieldCollection

Metadata

public PdfMetadata Metadata { get; }

The metadata associated with the current PDF document.

Type: PdfMetadata

PageCollection

public PdfPageCollection PageCollection { get; }

The collection of pages in the PDF document.

Type: PdfPageCollection

Methods

AppendDocument

public void AppendDocument(Document document)

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.

DetectAndAddFormFields

public void DetectAndAddFormFields()

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.

Edit

public static PdfEditor Edit(Document document)

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.

MakeSearchable

public void MakeSearchable()

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

Save

public void Save()

Saves the current changes made in the editor.

SaveAs

public void SaveAs(string path)

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

Parameters

NameTypeDescription
pathstringThe file path where the document will be saved.
public void SaveAs(Stream stream)

Saves the current changes to the specified stream.

Parameters

NameTypeDescription
streamStreamThe stream where the document will be saved.

Close

public void Close()

Closes the document currently being edited. The editor remains usable.

Resource management

public void Dispose()

PdfEditor implements IDisposable. Call Dispose() or use a C# using declaration to release its native handle right away. If you don’t, the handle is released when the object is garbage collected.