Optionalargs: {Optional actions to execute when an event is triggered.
OptionalonCalculate?: NutrientViewer.Actions.ActionAction to be performed to recalculate the value of a field.
The name of this event in the PDF spec is C.
OptionalonChange?: NutrientViewer.Actions.ActionExecute an action when the value of the field changes.
The name of this event in the PDF spec is V and can check the new value for validity.
OptionalonBlur?: NutrientViewer.Actions.JavaScriptActionExecute an action when the widget loses focus.
The name of this event in the PDF spec is Bl.
OptionalonChange?: NutrientViewer.Actions.JavaScriptActionAction to be performed when the user changes the value of the field.
The name of this event in the PDF spec is V.
OptionalonFocus?: NutrientViewer.Actions.JavaScriptActionExecute an action when the widget is focused.
The name of this event in the PDF spec is Fo.
OptionalonFormat?: NutrientViewer.Actions.JavaScriptActionAction to be performed before the field is formatted to display its current value.
The name of this event in the PDF spec is F.
OptionalonInput?: NutrientViewer.Actions.JavaScriptActionAction to be performed when the user types a key-stroke into a text field or combo box or modifies the selection in a scrollable list box.
The name of this event in the PDF spec is K.
OptionalonPointerDown?: NutrientViewer.Actions.ActionAction to be performed when the pointer is pressed.
OptionalonPointerEnter?: NutrientViewer.Actions.ActionAction to be performed when the pointer enters the field area.
OptionalonPointerLeave?: NutrientViewer.Actions.ActionAction to be performed when the pointer hovers the field.
OptionalonPointerUp?: NutrientViewer.Actions.ActionAction to be performed when the pointer is released.
Holds an immutable list of NutrientViewer.Annotations.WidgetAnnotation#ids.
Optional ReadonlycanThis property defines whether the user has permission to edit the group of this form field. The value of this field depends on the set of collaboration permissions defined in the JWT token.
It is only available when collaboration permissions is enabled on Server-Backed deployments.
OptionalgroupThis property is used to define the permission scope for this form-field, it's corresponding widget-annotations and form field values. If you change the group of a form field, the corresponding widget annotations and form field values will inherit it.
It is only available when collaboration permissions is enabled on Server-Backed deployments.
A unique identifier to describe the form field record. When a form field is created in the UI, the viewer has to generate a unique ID.
When changes are saved to the underlying form field provider, we call NutrientViewer.Instance#ensureChangesSaved to make sure the form field has been persisted from the provider.
Optional ReadonlyisThis property defines whether this form field can be deleted or not. The value of this field depends on the set of collaboration permissions defined in the JWT token.
It is only available when collaboration permissions is enabled on Server-Backed deployments.
Optional ReadonlyisThis property defines whether this form-field can be edited or not. The value of this field depends on the set of collaboration permissions defined in the JWT token.
It is only available when collaboration permissions is enabled on Server-Backed deployments.
Optional ReadonlyisThis property defines whether this form-field can be filled or not. The value of this field depends on the set of collaboration permissions defined in the JWT token.
It is only available when collaboration permissions is enabled on Server-Backed deployments.
Used to identify the form field in the UI or for accessibility.
Unique name of the form field (often referred to as fully qualified name). This name is used to link NutrientViewer.Annotations.WidgetAnnotation and is also used as an identifier for form field values.
Form fields with the noExport flag won't appear in the serialized payload of a form
submission.
The object ID of the form field object in the PDF.
Read only form fields can not be filled out (similar to disabled HTML input elements).
Required form fields must be filled out in order to submit the form.
NutrientViewer.FormFields.TextFormField, NutrientViewer.FormFields.ComboBoxFormField and
NutrientViewer.FormFields.ListBoxFormField with this flag set will be rendered with
the [PSPDFKit-Annotation-Widget-Required]https://www.nutrient.io/api/web/css-Widget-Annotation.html#.PSPDFKit-Annotation-Widget-Required public CSS class and the HTML required attribute set.
Returns a new instance of this Record type with all values set to their default values.
Returns a new instance of this Record type with the value for the specific key set to its default value.
Returns the value associated with the provided key, which may be the default value defined when creating the Record factory function.
If the requested key is not defined by this Record type, then notSetValue will be returned if provided. Note that this scenario would produce an error when using Flow or TypeScript.
OptionalnotSetValue: anyDeeply converts this Record to equivalent native JavaScript Object.
Note: This method may not be overridden. Objects with custom serialization to plain JS may override toJSON() instead.
Shallowly converts this Record to equivalent native JavaScript Object.
Shallowly converts this Record to equivalent JavaScript Object.
Form field type from which all form fields inherit. You can not instantiate from this type.
It is an Immutable.Record.
To retrieve a list of all form fields, use NutrientViewer.Instance#getFormFields.
Please see our forms guide article to learn more about form fields and for examples on how to create them.
Example
Creating a form field.
See