Skip to content

# PDFForm

Namespace: O2S.Components.PDF4NET.Forms

Defines an interactive Acrobat form.

    public class PDFForm

Inheritance Object → PDFForm

## Properties

### CalculatedFields

Gets the calculated fields.

    public PDFCalculatedFieldCollection CalculatedFields { get; }

Property Value

PDFCalculatedFieldCollection
The list of calculated fields in this form.

Remarks

The fields are calculated in the order they appear in this collection.

### CosDictionary

Gets or sets the raw PDF form object associated with this form.

    public PDFCosDictionary CosDictionary { get; internal set; }

Property Value

PDFCosDictionary

### Fields

Gets the form fields.

    public PDFFieldCollection Fields { get; }

Property Value

PDFFieldCollection
The collection of fields that compose this form.

### FormFillOptions

Gets or sets a set of options for filling form fields.

    public PDFFormFillOptions FormFillOptions { get; set; }

Property Value

PDFFormFillOptions
A PDFFormFillOptions object specifying various options for filling form fields.

### NeedAppearances

Gets or sets a value indicating whether to construct visual appearances for all field widgets in the document.

    public bool NeedAppearances { get; set; }

Property Value

Boolean
If true, visual appearances should be constructed for all field widgets.

## Methods

### ExportData(String, PDFFormDataFormat, String)

Exports the form data to a file.

    public void ExportData(string fileName, PDFFormDataFormat format, string pdfFileName)

Parameters

`fileName` String
The output file for form data.

`format` PDFFormDataFormat
The data format for export.

`pdfFileName` String
The PDF file name the data is exported from.

Remarks

The FDF/XFDF data files require a reference to a PDF file.

### ExportData(String, PDFFormDataFormat, String, PDFFormDataOptions)

Exports the form data to a file.

    public void ExportData(string fileName, PDFFormDataFormat format, string pdfFileName, PDFFormDataOptions exportDataOptions)

Parameters

`fileName` String
The output file for form data.

`format` PDFFormDataFormat
The data format for export.

`pdfFileName` String
The PDF file name the data is exported from.

`exportDataOptions` PDFFormDataOptions
Options specifies the data that is export from the PDF file. Applies to FDF/XFDF data format only

Remarks

The FDF/XFDF data files require a reference to a PDF file.

### ExportData(Stream, PDFFormDataFormat, String)

Exports the form data to a stream.

    public void ExportData(Stream stream, PDFFormDataFormat format, string pdfFileName)

Parameters

`stream` Stream
The output stream for form data.

`format` PDFFormDataFormat
The data format for export.

`pdfFileName` String
The PDF file name the data is exported from.

Remarks

The FDF/XFDF data files require a reference to a PDF file.

### ExportData(Stream, PDFFormDataFormat, String, PDFFormDataOptions)

Exports the form data to a stream.

    public void ExportData(Stream stream, PDFFormDataFormat format, string pdfFileName, PDFFormDataOptions exportDataOptions)

Parameters

`stream` Stream
The output stream for form data.

`format` PDFFormDataFormat
The data format for export.

`pdfFileName` String
The PDF file name the data is exported from.

`exportDataOptions` PDFFormDataOptions
Options specifies the data that is export from the PDF file. Applies to FDF/XFDF data format only

Remarks

The FDF/XFDF data files require a reference to a PDF file.

### FlattenField(PDFField)

Flattens the specified form field.

    public void FlattenField(PDFField field)

Parameters

`field` PDFField
The field to flatten.

Remarks

The field can no longer be edited after it has been flattened.

### FlattenField(PDFField, PDFStructureElement)

Flattens the specified form field and sets the result as content item for the given structure element.

    public void FlattenField(PDFField field, PDFStructureElement structureElement)

Parameters

`field` PDFField
The field to flatten.

`structureElement` PDFStructureElement
The structure element that represents the flatten field.

Remarks

The field can no longer be edited after it has been flattened.

### FlattenFields()

Flattens all the form fields.

    public void FlattenFields()

Remarks

After flattening the field the form is no longer editable.

### ImportData(String, PDFFormDataFormat)

Imports data from an external file.

    public void ImportData(string fileName, PDFFormDataFormat dataFormat)

Parameters

`fileName` String
The input file for data import.

`dataFormat` PDFFormDataFormat
The format of data in input stream.

### ImportData(String, PDFFormDataFormat, PDFFormDataOptions)

Imports data from an external file.

    public void ImportData(string fileName, PDFFormDataFormat dataFormat, PDFFormDataOptions importDataOptions)

Parameters

`fileName` String
The input file for data import.

`dataFormat` PDFFormDataFormat
The format of data in input stream.

`importDataOptions` PDFFormDataOptions
Options for importing data.

### ImportData(Stream, PDFFormDataFormat)

Imports data from a stream.

    public void ImportData(Stream stream, PDFFormDataFormat dataFormat)

Parameters

`stream` Stream
The input stream for data import.

`dataFormat` PDFFormDataFormat
The format of data in input stream.

### ImportData(Stream, PDFFormDataFormat, PDFFormDataOptions)

Imports data from a stream.

    public void ImportData(Stream stream, PDFFormDataFormat dataFormat, PDFFormDataOptions importDataOptions)

Parameters

`stream` Stream
The input stream for data import.

`dataFormat` PDFFormDataFormat
The format of data in input stream.

`importDataOptions` PDFFormDataOptions
Options for importing data.