ftos.files.pdf.form.getFields
Reads all form fields from a fillable PDF and returns them as a key, where value is the actual value set on the field.
The method throws exceptions that you can catch with try catch. In this case, your script keeps running, the error doesn’t block or kill execution.
This is a business logic method for business service components.
Syntax
ftos.files.pdf.form.getFields(sourceRealName: string): any
| Parameter | Type | Description |
|---|---|---|
sourceRealName
|
string | It’s the input the method expects, the name or path of the PDF file whose form fields you want to extract. |
Return Value
Returns an array of PDF form field objects, where each element is an representing one field (like a text box, checkbox, or dropdown) in the specified PDF form:
-
Name: the label of the interactive form field;
-
Value: containing the actual field value;
-
SampleValue: a sample for the field value;
-
IsRequired: supports true for required and false for optional;
-
IsReadOnly: supports true for editable and false for non-editable;
-
Type: the field type, such as textfield or RadioButtonField, CombTextField, etc.;
-
Description: a text with a description for the field, no maximum length set;
-
Options: a list of options, such as Male, Female for fields for combo boxes and lists. It can also have the value null if the list does not exist.
-
MaxLength: returns the number of characters allowed, if it doesn’t exist then it will return null.
{
"Name": "City",
"Value": "Rome",
"SampleValue": "Rome",
"IsRequired": false,
"IsReadOnly": false,
"Type": "ComboBoxField",
"Description": "Optional - Combo box: New York | London | Berlin | Paris | Rome",
"Options": [
"New York",
"London",
"Berlin",
"Paris",
"Rome"
]
"MaxLength":null
}