Forms
- Source:
Methods
(static) getFormElements() → {Promise.<Array.<FormElement>>}
Gets all the form elements for the current document.
- Source:
Returns:
A promise containing an array of the
FormElement
objects.
- Type
- Promise.<Array.<FormElement>>
Example
const result = await this.pdfRef.current?.getDocument().forms.getFormElements();
(static) updateButtonFormFieldValue(fullyQualifiedName, selected) → {Promise.<boolean>}
Updates a button form field value on the document. This is used for checkboxes and radio buttons.
Parameters:
Name | Type | Description |
---|---|---|
fullyQualifiedName |
string | The fully qualified name of the button form field to update. |
selected |
boolean | The new value of the button form field (true for selected, false for deselected). |
- Source:
Returns:
A promise containing the result of the operation.
- Type
- Promise.<boolean>
Example
const result = await this.pdfRef.current?.getDocument().forms.updateButtonFormFieldValue(name, true);
(static) updateChoiceFormFieldValue(fullyQualifiedName, selectedIndices) → {Promise.<boolean>}
Updates a choice form field value on the document. This is used for combo boxes and list boxes.
Parameters:
Name | Type | Description |
---|---|---|
fullyQualifiedName |
string | The fully qualified name of the choice form field to update. |
selectedIndices |
Array.<number> | The indices of the selected options in the choice form field. |
- Source:
Returns:
A promise containing the result of the operation.
- Type
- Promise.<boolean>
Example
const result = await this.pdfRef.current?.getDocument().forms.updateChoiceFormFieldValue(name, [0, 2]);
(static) updateTextFormFieldValue(fullyQualifiedName, value) → {Promise.<boolean>}
Updates a text form field value on the document.
Parameters:
Name | Type | Description |
---|---|---|
fullyQualifiedName |
string | The fully qualified name of the text form field to update. |
value |
string | The new text value. |
- Source:
Returns:
A promise containing the result of the operation.
- Type
- Promise.<boolean>
Example
const result = await this.pdfRef.current?.getDocument().forms.updateTextFormFieldValue(name, 'New text');