Nutrient Web SDK

Class TextFormField

A text input element, that can either span a single or multiple lines.

To retrieve a list of all form fields, use NutrientViewer.Instance#getFormFields.

Class

Hierarchy

FormFieldTextFormField

Constructors

Properties

{ … } | null

Optional actions to execute when an event is triggered.

PropertyDescription
onCalculate

Action to be performed to recalculate the value of a field.

The name of this event in the PDF spec is C.

onChange

Execute 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.

onBlur

Execute an action when the widget loses focus.

The name of this event in the PDF spec is Bl.

onChange

Action to be performed when the user changes the value of the field.

The name of this event in the PDF spec is V.

onFocus

Execute an action when the widget is focused.

The name of this event in the PDF spec is Fo.

onFormat

Action to be performed before the field is formatted to display its current value.

The name of this event in the PDF spec is F.

onInput

Action 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.

onPointerDown

Action to be performed when the pointer is pressed.

onPointerEnter

Action to be performed when the pointer enters the field area.

onPointerLeave

Action to be performed when the pointer hovers the field.

onPointerUp

Action to be performed when the pointer is released.

Default Value

null

canSetGroup

OptionalReadonly
boolean

This 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.

boolean

If true, every character will have an input element on their own which is evenly distributed inside the bounding box of the widget annotation. When this is set, the form field must have a maxLength.

Default Value

false
string

Similar to the value property. The default values are only used when a form needs to be reset.

boolean

If true, the field does not scroll (horizontally for single-line fields, vertically for multiple-line fields) to accommodate more text than fits within its annotation’s rectangle. Once the field is full, no further text is accepted.

Default Value

false
boolean

If true, text entered in the field is not spell-checked.

Default Value

false

group

Optional
string | null

This 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.

string

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.

isDeletable

OptionalReadonly
boolean

This 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.

isEditable

OptionalReadonly
boolean

This 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.

isFillable

OptionalReadonly
boolean

This 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.

string

Used to identify the form field in the UI or for accessibility.

maxLength

Optional
number | null

The maximum length of the field’s text, in characters. If none is set, the size is not limited.

Default Value

null
boolean

If true, the field can contain multiple lines of text. Otherwise, the field’s text is restricted to a single line.

Default Value

false
string

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.

boolean

Form fields with the noExport flag won't appear in the serialized payload of a form submission.

Default Value

false
boolean

If true, the field is intended for entering a secure password that should not be echoed visibly to the screen. Characters typed from the keyboard should instead be echoed in some unreadable form, such as asterisks or bullet characters.

This is currently only support for single line text inputs.

Default Value

false
number

The object ID of the form field object in the PDF.

boolean

Read only form fields can not be filled out (similar to disabled HTML input elements).

Default Value

false
boolean

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 public CSS class and the HTML required attribute set.

Default Value

false

value

Readonly
string

The current value of the form field. In order to modify it, instance.setFormFieldValues() should be used.

Immutable Record API

31

Indexable

  • readonly [key: string]: any
string

The name provided to Record(values, name) can be accessed with displayName.

  • Returns a new instance of this Record type with all values set to their default values.

    Returns

    this
  • Parameters

    otherunknown

    Returns

    boolean
  • Parameters

    keystring

    Returns

    key is string
  • Parameters

    merger(oldVal: unknown, newVal: unknown, key: unknown) => unknown
    ...collections
    (Iterable<[string, unknown], any, any> | Partial<{ … }>)[]

    Returns

    this
  • Parameters

    keyPathIterable<unknown>
    ...collectionsunknown[]

    Returns

    this
  • Deeply 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.

    Returns

    { … }
  • Parameters

    keyPathIterable<unknown>
    updater(value: unknown) => unknown

    Returns

    this
  • Note: Not all methods can be used on a mutable collection or within withMutations! Only set may be used mutatively.

    Parameters

    mutator(mutable: this) => unknown

    Returns

    this

    See Also

    • Map#withMutations