Class PdfForm
The document's interactive form (AcroForm): its fields, and the Add… methods that create new ones. Each Add… method makes a field with its widget on the page, registers it in the form and on the page, and builds its appearance, so the field shows in every viewer and survives flattening and merging.
public sealed class PdfForm : PdfDictionary
- Inheritance
-
objectPdfForm
- Inherited Members
- Extension Methods
Properties
- Fields
Gets the fields collection of this form. It is created if it does not exist.
- NeedAppearances
Gets or sets whether viewers shall build the appearances of the form's fields (/NeedAppearances). FreePDF builds appearances when fields are filled; this flag is for appearances it cannot build. PDF 2.0 deprecates it and PDF/A does not allow it.
Methods
- AddCheckBox(string, PdfPage, XRect, PdfFormFieldStyle?)
Adds a check box, unchecked. Its on state is /Yes; set Checked to check it.
- AddComboBox(string, PdfPage, XRect, IEnumerable<string>, PdfFormFieldStyle?)
Adds a combo box (a drop-down list) with the given options, none selected.
- AddListBox(string, PdfPage, XRect, IEnumerable<string>, PdfFormFieldStyle?)
Adds a list box with the given options, none selected. Set the MultiSelect flag on the returned field to allow several selections.
- AddRadioButtonGroup(string, PdfPage, IReadOnlyList<(string Value, XRect Rectangle)>, PdfFormFieldStyle?)
Adds a group of radio buttons on one page, none selected. Each button's value is its export value and the name of its on state; select one with SelectedValue. "Off" is the name of the off state and cannot be a value, nor can a value start with a slash.
- AddSignatureField(string, PdfPage, XRect, PdfFormFieldStyle?)
Adds an empty signature field, for example a "sign here" box. Sign into it with
DigitalSignatureOptions.FieldName, or leave it for the recipient to sign.
- AddTextField(string, PdfPage, XRect, PdfFormFieldStyle?)
Adds a text field. The rectangle is in points from the top left corner of the visible page (its crop box, or its media box if it has none), with y growing downwards as for XGraphics. Set flags such as Multiline or Password on the returned field, and its text with Text.