# PdfDocumentForms

Fluent simple AcroForm operations for a PdfDocument.

Class 

`OfficeIMO.Pdf`

**Namespace**

`OfficeIMO.Pdf`

**Assembly**

`OfficeIMO.Pdf`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[PdfDocumentForms.cs:18](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfDocumentForms.cs#L18)

**Modifiers**

sealed

Fluent simple AcroForm operations for a [PdfDocument](/api/pdf/officeimo-pdf-pdfdocument/).

## Inheritance

- object
- PdfDocumentForms

## Usage

Explore 1 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 1

- Property [PdfDocument.Forms](/api/pdf/officeimo-pdf-pdfdocument/#property-forms)

Filter members 

Show inherited

## Methods

AppendRevision 4 overloads

`public PdfDocument AppendRevision(IReadOnlyDictionary<string, string> fieldValues, bool keepNeedAppearances = true)` [#](#method-appendrevision-collections-generic-ireadonlydictionary-system-string-system-string-boolean)

[PdfDocumentForms.cs:127](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfDocumentForms.cs#L127)

Appends a simple AcroForm field-value revision without rewriting the existing PDF bytes.

Parameters

**fieldValues System.Collections.Generic.IReadOnlyDictionary<string, string> required**

**keepNeedAppearances bool = true optional**

Returns

`PdfDocument`

`public PdfDocument AppendRevision(IReadOnlyDictionary<string, string> fieldValues, PdfIncrementalFormFieldUpdateOptions? formOptions, CancellationToken cancellationToken = default)` [#](#method-appendrevision-collections-generic-ireadonlydictionary-system-string-system-string-officeimo-pdf-pdfincrementalformfieldupdateoptions-threading-cancellationtoken)

[PdfDocumentForms.cs:134](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfDocumentForms.cs#L134)

Appends a simple AcroForm field-value revision without rewriting the existing PDF bytes.

Parameters

**fieldValues System.Collections.Generic.IReadOnlyDictionary<string, string> required**

**formOptions OfficeIMO.Pdf.PdfIncrementalFormFieldUpdateOptions? required**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`PdfDocument`

`public PdfDocument AppendRevision(IReadOnlyDictionary<string, PdfFormFieldValue> fieldValues, bool keepNeedAppearances = true)` [#](#method-appendrevision-collections-generic-ireadonlydictionary-system-string-officeimo-pdf-pdfformfieldvalue-boolean)

[PdfDocumentForms.cs:172](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfDocumentForms.cs#L172)

Appends a simple AcroForm field-value revision, including multi-value fields, without rewriting the existing PDF bytes.

Parameters

**fieldValues System.Collections.Generic.IReadOnlyDictionary<string, OfficeIMO.Pdf.PdfFormFieldValue> required**

**keepNeedAppearances bool = true optional**

Returns

`PdfDocument`

`public PdfDocument AppendRevision(IReadOnlyDictionary<string, PdfFormFieldValue> fieldValues, PdfIncrementalFormFieldUpdateOptions? formOptions, CancellationToken cancellationToken = default)` [#](#method-appendrevision-collections-generic-ireadonlydictionary-system-string-officeimo-pdf-pdfformfieldvalue-officeimo-pdf-pdfincrementalformfieldupdateoptions-threading-cancellationtoken)

[PdfDocumentForms.cs:179](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfDocumentForms.cs#L179)

Appends a simple AcroForm field-value revision, including multi-value fields, without rewriting the existing PDF bytes.

Parameters

**fieldValues System.Collections.Generic.IReadOnlyDictionary<string, OfficeIMO.Pdf.PdfFormFieldValue> required**

**formOptions OfficeIMO.Pdf.PdfIncrementalFormFieldUpdateOptions? required**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`PdfDocument`

Edit 2 overloads

`public PdfAcroFormEditResult Edit(Action<PdfAcroFormEditSession> edit)` [#](#method-edit-action-officeimo-pdf-pdfacroformeditsession)

[PdfDocumentForms.cs:341](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfDocumentForms.cs#L341)

Transactionally creates or edits fields, widgets, ordering, and selective flattening.

Parameters

**edit System.Action<OfficeIMO.Pdf.PdfAcroFormEditSession> required**

Returns

`PdfAcroFormEditResult`

`public PdfAcroFormEditResult Edit(Action<PdfAcroFormEditSession> edit, PdfFormFillerOptions appearanceOptions, CancellationToken cancellationToken = default)` [#](#method-edit-action-officeimo-pdf-pdfacroformeditsession-officeimo-pdf-pdfformfilleroptions-threading-cancellationtoken)

[PdfDocumentForms.cs:345](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfDocumentForms.cs#L345)

Transactionally creates or edits fields using the configured embedded-font policy for generated appearances.

Parameters

**edit System.Action<OfficeIMO.Pdf.PdfAcroFormEditSession> required**

**appearanceOptions OfficeIMO.Pdf.PdfFormFillerOptions required**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`PdfAcroFormEditResult`

`public PdfFormDataSet ExportData()` [#](#method-exportdata)

[PdfDocumentForms.cs:315](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfDocumentForms.cs#L315)

Exports readable field values as a typed data set.

Returns

`PdfFormDataSet`

`public string ExportXfdf()` [#](#method-exportxfdf)

[PdfDocumentForms.cs:318](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfDocumentForms.cs#L318)

Exports readable field values as XFDF.

Returns

`string`

Fill 4 overloads

`public PdfDocument Fill(IReadOnlyDictionary<string, string> fieldValues)` [#](#method-fill-collections-generic-ireadonlydictionary-system-string-system-string)

[PdfDocumentForms.cs:31](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfDocumentForms.cs#L31)

Creates a new PDF with simple form fields filled.

Parameters

**fieldValues System.Collections.Generic.IReadOnlyDictionary<string, string> required**

Returns

`PdfDocument`

`public PdfDocument Fill(IReadOnlyDictionary<string, string> fieldValues, PdfFormFillerOptions formOptions, CancellationToken cancellationToken = default)` [#](#method-fill-collections-generic-ireadonlydictionary-system-string-system-string-officeimo-pdf-pdfformfilleroptions-threading-cancellationtoken)

[PdfDocumentForms.cs:38](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfDocumentForms.cs#L38)

Creates a new PDF with simple form fields filled.

Parameters

**fieldValues System.Collections.Generic.IReadOnlyDictionary<string, string> required**

**formOptions OfficeIMO.Pdf.PdfFormFillerOptions required**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`PdfDocument`

`public PdfDocument Fill(IReadOnlyDictionary<string, PdfFormFieldValue> fieldValues)` [#](#method-fill-collections-generic-ireadonlydictionary-system-string-officeimo-pdf-pdfformfieldvalue)

[PdfDocumentForms.cs:79](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfDocumentForms.cs#L79)

Creates a new PDF with simple form fields filled, including multi-value fields.

Parameters

**fieldValues System.Collections.Generic.IReadOnlyDictionary<string, OfficeIMO.Pdf.PdfFormFieldValue> required**

Returns

`PdfDocument`

`public PdfDocument Fill(IReadOnlyDictionary<string, PdfFormFieldValue> fieldValues, PdfFormFillerOptions formOptions, CancellationToken cancellationToken = default)` [#](#method-fill-collections-generic-ireadonlydictionary-system-string-officeimo-pdf-pdfformfieldvalue-officeimo-pdf-pdfformfilleroptions-threading-cancellationtoken)

[PdfDocumentForms.cs:86](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfDocumentForms.cs#L86)

Creates a new PDF with simple form fields filled, including multi-value fields.

Parameters

**fieldValues System.Collections.Generic.IReadOnlyDictionary<string, OfficeIMO.Pdf.PdfFormFieldValue> required**

**formOptions OfficeIMO.Pdf.PdfFormFillerOptions required**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`PdfDocument`

FillAndFlatten 4 overloads

`public PdfDocument FillAndFlatten(IReadOnlyDictionary<string, string> fieldValues)` [#](#method-fillandflatten-collections-generic-ireadonlydictionary-system-string-system-string)

[PdfDocumentForms.cs:258](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfDocumentForms.cs#L258)

Creates a new PDF with simple form fields filled and flattened.

Parameters

**fieldValues System.Collections.Generic.IReadOnlyDictionary<string, string> required**

Returns

`PdfDocument`

`public PdfDocument FillAndFlatten(IReadOnlyDictionary<string, string> fieldValues, PdfFormFillerOptions formOptions, CancellationToken cancellationToken = default)` [#](#method-fillandflatten-collections-generic-ireadonlydictionary-system-string-system-string-officeimo-pdf-pdfformfilleroptions-threading-cancellationtoken)

[PdfDocumentForms.cs:265](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfDocumentForms.cs#L265)

Creates a new PDF with simple form fields filled and flattened.

Parameters

**fieldValues System.Collections.Generic.IReadOnlyDictionary<string, string> required**

**formOptions OfficeIMO.Pdf.PdfFormFillerOptions required**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`PdfDocument`

`public PdfDocument FillAndFlatten(IReadOnlyDictionary<string, PdfFormFieldValue> fieldValues)` [#](#method-fillandflatten-collections-generic-ireadonlydictionary-system-string-officeimo-pdf-pdfformfieldvalue)

[PdfDocumentForms.cs:288](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfDocumentForms.cs#L288)

Creates a new PDF with simple form fields filled and flattened, including multi-value fields.

Parameters

**fieldValues System.Collections.Generic.IReadOnlyDictionary<string, OfficeIMO.Pdf.PdfFormFieldValue> required**

Returns

`PdfDocument`

`public PdfDocument FillAndFlatten(IReadOnlyDictionary<string, PdfFormFieldValue> fieldValues, PdfFormFillerOptions formOptions, CancellationToken cancellationToken = default)` [#](#method-fillandflatten-collections-generic-ireadonlydictionary-system-string-officeimo-pdf-pdfformfieldvalue-officeimo-pdf-pdfformfilleroptions-threading-cancellationtoken)

[PdfDocumentForms.cs:295](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfDocumentForms.cs#L295)

Creates a new PDF with simple form fields filled and flattened, including multi-value fields.

Parameters

**fieldValues System.Collections.Generic.IReadOnlyDictionary<string, OfficeIMO.Pdf.PdfFormFieldValue> required**

**formOptions OfficeIMO.Pdf.PdfFormFillerOptions required**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`PdfDocument`

Flatten 4 overloads

`public PdfDocument Flatten()` [#](#method-flatten)

[PdfDocumentForms.cs:217](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfDocumentForms.cs#L217)

Creates a new PDF with simple form fields flattened.

Returns

`PdfDocument`

`public PdfDocument Flatten(PdfFormFillerOptions formOptions, CancellationToken cancellationToken = default)` [#](#method-flatten-officeimo-pdf-pdfformfilleroptions-threading-cancellationtoken)

[PdfDocumentForms.cs:224](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfDocumentForms.cs#L224)

Creates a new PDF with simple form fields flattened.

Parameters

**formOptions OfficeIMO.Pdf.PdfFormFillerOptions required**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`PdfDocument`

`public PdfDocument Flatten(params string[] fieldNames)` [#](#method-flatten-string)

[PdfDocumentForms.cs:230](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfDocumentForms.cs#L230)

Creates a new PDF with only the named simple form fields flattened.

Parameters

**fieldNames string[] required**

Returns

`PdfDocument`

`public PdfDocument Flatten(IReadOnlyCollection<string> fieldNames, PdfFormFillerOptions formOptions, CancellationToken cancellationToken = default)` [#](#method-flatten-collections-generic-ireadonlycollection-system-string-officeimo-pdf-pdfformfilleroptions-threading-cancellationtoken)

[PdfDocumentForms.cs:235](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfDocumentForms.cs#L235)

Creates a new PDF with only the named simple form fields flattened.

Parameters

**fieldNames System.Collections.Generic.IReadOnlyCollection<string> required**

**formOptions OfficeIMO.Pdf.PdfFormFillerOptions required**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`PdfDocument`

`public PdfFormInteractionInfo GetForInteraction()` [#](#method-getforinteraction)

[PdfDocumentForms.cs:18](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfDocumentForms.cs#L18)

Reads the fields and widgets needed to display and fill a form, without extracting page content.

Returns

`PdfFormInteractionInfo`

`public PdfDocument ImportData(PdfFormDataSet data, PdfFormFillerOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-importdata-officeimo-pdf-pdfformdataset-officeimo-pdf-pdfformfilleroptions-threading-cancellationtoken)

[PdfDocumentForms.cs:322](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfDocumentForms.cs#L322)

Imports a typed data set through the validated form filler.

Parameters

**data OfficeIMO.Pdf.PdfFormDataSet required**

**options OfficeIMO.Pdf.PdfFormFillerOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`PdfDocument`

`public PdfDocument ImportXfdf(string xfdf, PdfFormFillerOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-importxfdf-string-officeimo-pdf-pdfformfilleroptions-threading-cancellationtoken)

[PdfDocumentForms.cs:332](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfDocumentForms.cs#L332)

Imports XFDF through the validated form filler.

Parameters

**xfdf string required**

**options OfficeIMO.Pdf.PdfFormFillerOptions? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`PdfDocument`

`public PdfStaticFormRecognitionReport RecognizeStaticLayout(PdfStaticFormRecognitionOptions? options = null, IReadOnlyList<PdfStaticFormTextEvidence>? ocrText = null, CancellationToken cancellationToken = default)` [#](#method-recognizestaticlayout-officeimo-pdf-pdfstaticformrecognitionoptions-collections-generic-ireadonlylist-officeimo-pdf-pdfstaticformtextevidence-threading-cancellationtoken)

[PdfDocumentForms.cs:355](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Core/PdfDocumentForms.cs#L355)

Proposes fields from static page outlines and labels without changing the document.

Parameters

**options OfficeIMO.Pdf.PdfStaticFormRecognitionOptions? = null optional**

**ocrText System.Collections.Generic.IReadOnlyList<OfficeIMO.Pdf.PdfStaticFormTextEvidence>? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`PdfStaticFormRecognitionReport`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

<!-- PowerForge markdown artifact sha256:E28A48B83E43B2F3624D7059237A18AA6B5BAE0B694C458ECAEBC3D191D66EB1 -->
