Form
Overview
Form is a class in Aspose.PDF FOSS for TypeScript.
The document’s interactive form: terminal fields of the /AcroForm tree.
This class declares 10 methods for Form objects in TypeScript programs.
Available methods include: AddCheckbox, AddComboBox, AddListBox, AddPushButton, AddRadioGroup, AddTextField, GenerateAppearances, Get, RemoveField, constructor.
All public members are accessible to any TypeScript application after installing the Aspose.PDF FOSS for TypeScript package.
Properties: Dict, Fields.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
Fields | Field[] | Read | Gets the fields. |
Dict | PdfDict | undefined | Read | Gets the dict. |
Methods
| Signature | Description |
|---|---|
constructor(doc: Document) | Calls constructor(doc) on this Form instance. |
Get(fullName: string) → Field | undefined | The field whose FullName matches exactly, or undefined. |
AddTextField(init: TextFieldInit) → TextField | Create a single-line text field on init.page and return its handle. |
AddCheckbox(init: CheckboxInit) → CheckboxField | Create a checkbox on init.page and return its handle. |
AddRadioGroup(init: RadioGroupInit) → RadioField | Create a radio group whose kid widgets may sit on different pages, and return the parent field’s handle. |
AddComboBox(init: ComboBoxInit) → ChoiceField | Create a combo box (a dropdown) on init.page and return its handle. |
AddListBox(init: ListBoxInit) → ChoiceField | Create a list box on init.page and return its handle. |
AddPushButton(init: PushButtonInit) → ButtonField | Create a push button on init.page and return its handle. |
RemoveField(field: Field | string) → boolean | Remove a terminal field: unwire it from /AcroForm /Fields (or its parent’s /Kids) and drop its widgets from every page’s /Annots. |
GenerateAppearances() | Generate appearance streams for every field, then drop the AcroForm /NeedAppearances flag so the document renders identically everywhere. |