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
| Name | Type | Description |
|---|---|---|
document | Document | The 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
| Name | Type | Description |
|---|---|---|
document | Document | The 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
| Name | Type | Description |
|---|---|---|
path | string | The file path where the document will be saved. |
public void SaveAs(Stream stream)Saves the current changes to the specified stream.
Parameters
| Name | Type | Description |
|---|---|---|
stream | Stream | The 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.