PdfFormField Class
A field of the interactive form of a document (ISO 32000-2, 12.7.4): a node of the field hierarchy. A terminal field has a value and widgets, the annotations that show it on the pages; a non-terminal field holds other fields, whose names are qualified by its name.
public class PdfFormFieldRemarks
The derived classes represent the terminal fields of each type: PdfTextField, PdfCheckBoxField, PdfRadioButtonField, PdfPushButtonField, PdfChoiceField and PdfSignatureField. The other fields (non-terminal fields, unknown types) are of this class.
Properties
| Name | Description |
|---|---|
| AlternateName | Gets or sets the alternate name of the field (/TU): the text the user interface shows, and assistive technologies read. |
| Children | Gets the child fields, for a non-terminal field. |
| Dictionary | Gets the field dictionary. For a field with one widget, it can also be the widget annotation (a merged dictionary). |
| FieldType | Gets the field type (/FT, inherited): Tx, Btn, Ch or Sig, or null for a non-terminal field without type. |
| Flags | Gets or sets the flags of the field (/Ff, inherited, 12.7.4.1 and the tables of the field types). |
| Form | Gets the form of the field. |
| FullName | Gets the fully qualified name of the field: the partial names of the field and its ancestors, separated by periods (12.7.4.2). |
| IsReadOnly | Gets or sets a value indicating whether the user cannot change the value of the field (bit 1 of PdfFormField.Flags). |
| IsRequired | Gets or sets a value indicating whether the field must have a value when the form is submitted (bit 2 of PdfFormField.Flags). |
| IsTerminal | Gets a value indicating whether the field is a terminal field: it has no child fields. |
| Name | Gets the partial name of the field (/T). |
| Parent | Gets the parent field, or null for a field at the top of the hierarchy. |
| Reference | Gets the reference to the field dictionary, or null for a direct object. |
| Value | Gets or sets the value of the field (/V, inherited) as a text: a text string or a name; null when it has none. |
| Widgets | Gets the widgets of the field: the annotations that show it on the pages. A widget that is on no page is left out. |
AlternateName
PdfFormField.csChildren
PdfFormField.csGets the child fields, for a non-terminal field.
public IReadOnlyList<PdfFormField> Children { get; }Property value
Dictionary
PdfFormField.csGets the field dictionary. For a field with one widget, it can also be the widget annotation (a merged dictionary).
public PdfDictionary Dictionary { get; }Property value
FieldType
PdfFormField.csFlags
PdfFormField.csForm
PdfFormField.csFullName
PdfFormField.csIsReadOnly
PdfFormField.csGets or sets a value indicating whether the user cannot change the value of the field (bit 1 of PdfFormField.Flags).
public bool IsReadOnly { get; set; }Property value
IsRequired
PdfFormField.csGets or sets a value indicating whether the field must have a value when the form is submitted (bit 2 of PdfFormField.Flags).
public bool IsRequired { get; set; }Property value
IsTerminal
PdfFormField.csName
PdfFormField.csParent
PdfFormField.csGets the parent field, or null for a field at the top of the hierarchy.
public PdfFormField? Parent { get; }Property value
Reference
PdfFormField.csGets the reference to the field dictionary, or null for a direct object.
public PdfReference? Reference { get; }Property value
Value
PdfFormField.csGets or sets the value of the field (/V, inherited) as a text: a text string or a name; null when it has none.
public virtual string? Value { get; set; }Property value
Exceptions
NotSupportedException- The value of the field cannot be set: a push button, a signature field, a non-terminal field or a field of an unknown type.
Remarks
The value of a text field, a choice field, a check box (its on state or Off) and a group of radio buttons (its option) can be set; their appearances are updated.
Widgets
PdfFormField.csGets the widgets of the field: the annotations that show it on the pages. A widget that is on no page is left out.
public IReadOnlyList<PdfAnnotation> Widgets { get; }