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

NameTypeAccessDescription
FieldsField[]ReadGets the fields.
DictPdfDict | undefinedReadGets the dict.

Methods

SignatureDescription
constructor(doc: Document)Calls constructor(doc) on this Form instance.
Get(fullName: string)Field | undefinedThe field whose FullName matches exactly, or undefined.
AddTextField(init: TextFieldInit)TextFieldCreate a single-line text field on init.page and return its handle.
AddCheckbox(init: CheckboxInit)CheckboxFieldCreate a checkbox on init.page and return its handle.
AddRadioGroup(init: RadioGroupInit)RadioFieldCreate a radio group whose kid widgets may sit on different pages, and return the parent field’s handle.
AddComboBox(init: ComboBoxInit)ChoiceFieldCreate a combo box (a dropdown) on init.page and return its handle.
AddListBox(init: ListBoxInit)ChoiceFieldCreate a list box on init.page and return its handle.
AddPushButton(init: PushButtonInit)ButtonFieldCreate a push button on init.page and return its handle.
RemoveField(field: Field | string)booleanRemove 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.