Nutrient Web SDK
    Preparing search index...

    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.

    Creating a form field.

    const widget = new NutrientViewer.Annotations.WidgetAnnotation({
    // Generate unique ID so it can be referenced in form field before the widget is created.
    id: NutrientViewer.generateInstantId(),
    pageIndex: 0,
    formFieldName: 'form-field',
    boundingBox: new NutrientViewer.Geometry.Rect({
    left: 50,
    top: 50,
    width: 50,
    height: 50,
    }),
    }),
    const formField = new NutrientViewer.FormFields.TextFormField({
    name: 'form-field',
    annotationIds: new NutrientViewer.Immutable.List([widget.id]),
    })
    instance.create([widget, formField]);

    Hierarchy

    Indexable

    • readonly [key: string]: any
    Index

    Constructors

    • Parameters

      • Optionalargs: {
            additionalActions?: any;
            annotationIds?: NutrientViewer.Immutable.List<string>;
            canSetGroup?: boolean;
            group?: null | string;
            id?: string;
            isDeletable?: boolean;
            isEditable?: boolean;
            isFillable?: boolean;
            label?: string;
            name?: string;
            noExport?: boolean;
            pdfObjectId?: null | number;
            readOnly?: boolean;
            required?: boolean;
            [key: string]: any;
        }

      Returns NutrientViewer.FormFields.FormField

    Properties

    additionalActions: any

    Optional actions to execute when an event is triggered.

    null

    TODO_RITESH: https://www.nutrient.io/api/web/NutrientViewer.FormFieldAdditionalActions.html
    annotationIds: NutrientViewer.Immutable.List<string>
    canSetGroup?: 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.

    group?: null | string

    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.

    id: 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?: 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?: 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?: 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.

    label: string

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

    name: 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.

    noExport: boolean

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

    false
    
    pdfObjectId: number

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

    readOnly: boolean

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

    false
    
    required: 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]https://www.nutrient.io/api/web/css-Widget-Annotation.html#.PSPDFKit-Annotation-Widget-Required public CSS class and the HTML required attribute set.

    false
    

    Methods

    • Returns IterableIterator<
          [
              keyof {
                  additionalActions?: any;
                  annotationIds?: NutrientViewer.Immutable.List<string>;
                  canSetGroup?: boolean;
                  group?: null | string;
                  id?: string;
                  isDeletable?: boolean;
                  isEditable?: boolean;
                  isFillable?: boolean;
                  label?: string;
                  name?: string;
                  noExport?: boolean;
                  pdfObjectId?: null | number;
                  readOnly?: boolean;
                  required?: boolean;
                  [key: string]: any;
              },
              any,
          ],
      >

    • Returns this

      Map#asImmutable

    • Returns this

      Map#asMutable

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

      Returns this

    • Returns a new instance of this Record type with the value for the specific key set to its default value.

      Type Parameters

      • K extends keyof {
            additionalActions?: any;
            annotationIds?: NutrientViewer.Immutable.List<string>;
            canSetGroup?: boolean;
            group?: null | string;
            id?: string;
            isDeletable?: boolean;
            isEditable?: boolean;
            isFillable?: boolean;
            label?: string;
            name?: string;
            noExport?: boolean;
            pdfObjectId?: null | number;
            readOnly?: boolean;
            required?: boolean;
            [key: string]: any;
        }

      Parameters

      • key: K

      Returns this

      remove

    • Parameters

      Returns this

      removeIn

    • Parameters

      • other: any

      Returns boolean

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

      Type Parameters

      • K extends keyof {
            additionalActions?: any;
            annotationIds?: NutrientViewer.Immutable.List<string>;
            canSetGroup?: boolean;
            group?: null | string;
            id?: string;
            isDeletable?: boolean;
            isEditable?: boolean;
            isFillable?: boolean;
            label?: string;
            name?: string;
            noExport?: boolean;
            pdfObjectId?: null | number;
            readOnly?: boolean;
            required?: boolean;
            [key: string]: any;
        }

      Parameters

      • key: K
      • OptionalnotSetValue: any

      Returns {
          additionalActions?: any;
          annotationIds?: NutrientViewer.Immutable.List<string>;
          canSetGroup?: boolean;
          group?: null | string;
          id?: string;
          isDeletable?: boolean;
          isEditable?: boolean;
          isFillable?: boolean;
          label?: string;
          name?: string;
          noExport?: boolean;
          pdfObjectId?: null | number;
          readOnly?: boolean;
          required?: boolean;
          [key: string]: any;
      }[K]

    • Type Parameters

      • T

      Parameters

      • key: string
      • notSetValue: T

      Returns T

    • Parameters

      Returns any

    • Parameters

      • key: string

      Returns key is string

    • Returns number

    • Parameters

      Returns boolean

    • Parameters

      • ...collections: (
            | Iterable<[string, any]>
            | Partial<
                {
                    additionalActions?: any;
                    annotationIds?: NutrientViewer.Immutable.List<string>;
                    canSetGroup?: boolean;
                    group?: null | string;
                    id?: string;
                    isDeletable?: boolean;
                    isEditable?: boolean;
                    isFillable?: boolean;
                    label?: string;
                    name?: string;
                    noExport?: boolean;
                    pdfObjectId?: null | number;
                    readOnly?: boolean;
                    required?: boolean;
                    [key: string]: any;
                },
            >
        )[]

      Returns this

    • Parameters

      • ...collections: (
            | Iterable<[string, any]>
            | Partial<
                {
                    additionalActions?: any;
                    annotationIds?: NutrientViewer.Immutable.List<string>;
                    canSetGroup?: boolean;
                    group?: null | string;
                    id?: string;
                    isDeletable?: boolean;
                    isEditable?: boolean;
                    isFillable?: boolean;
                    label?: string;
                    name?: string;
                    noExport?: boolean;
                    pdfObjectId?: null | number;
                    readOnly?: boolean;
                    required?: boolean;
                    [key: string]: any;
                },
            >
        )[]

      Returns this

    • Parameters

      • keyPath: Iterable<any>
      • ...collections: any[]

      Returns this

    • Parameters

      • merger: (oldVal: any, newVal: any, key: any) => any
      • ...collections: (
            | Iterable<[string, any]>
            | Partial<
                {
                    additionalActions?: any;
                    annotationIds?: NutrientViewer.Immutable.List<string>;
                    canSetGroup?: boolean;
                    group?: null | string;
                    id?: string;
                    isDeletable?: boolean;
                    isEditable?: boolean;
                    isFillable?: boolean;
                    label?: string;
                    name?: string;
                    noExport?: boolean;
                    pdfObjectId?: null | number;
                    readOnly?: boolean;
                    required?: boolean;
                    [key: string]: any;
                },
            >
        )[]

      Returns this

    • Parameters

      • keyPath: Iterable<any>
      • ...collections: any[]

      Returns this

    • Parameters

      • merger: (
            oldVal: any,
            newVal: any,
            key: keyof {
                additionalActions?: any;
                annotationIds?: NutrientViewer.Immutable.List<string>;
                canSetGroup?: boolean;
                group?: null | string;
                id?: string;
                isDeletable?: boolean;
                isEditable?: boolean;
                isFillable?: boolean;
                label?: string;
                name?: string;
                noExport?: boolean;
                pdfObjectId?: null | number;
                readOnly?: boolean;
                required?: boolean;
                [key: string]: any;
            },
        ) => any
      • ...collections: (
            | Iterable<[string, any]>
            | Partial<
                {
                    additionalActions?: any;
                    annotationIds?: NutrientViewer.Immutable.List<string>;
                    canSetGroup?: boolean;
                    group?: null | string;
                    id?: string;
                    isDeletable?: boolean;
                    isEditable?: boolean;
                    isFillable?: boolean;
                    label?: string;
                    name?: string;
                    noExport?: boolean;
                    pdfObjectId?: null | number;
                    readOnly?: boolean;
                    required?: boolean;
                    [key: string]: any;
                },
            >
        )[]

      Returns this

    • Type Parameters

      • K extends keyof {
            additionalActions?: any;
            annotationIds?: NutrientViewer.Immutable.List<string>;
            canSetGroup?: boolean;
            group?: null | string;
            id?: string;
            isDeletable?: boolean;
            isEditable?: boolean;
            isFillable?: boolean;
            label?: string;
            name?: string;
            noExport?: boolean;
            pdfObjectId?: null | number;
            readOnly?: boolean;
            required?: boolean;
            [key: string]: any;
        }

      Parameters

      • key: K

      Returns this

    • Parameters

      Returns this

    • Type Parameters

      • K extends keyof {
            additionalActions?: any;
            annotationIds?: NutrientViewer.Immutable.List<string>;
            canSetGroup?: boolean;
            group?: null | string;
            id?: string;
            isDeletable?: boolean;
            isEditable?: boolean;
            isFillable?: boolean;
            label?: string;
            name?: string;
            noExport?: boolean;
            pdfObjectId?: null | number;
            readOnly?: boolean;
            required?: boolean;
            [key: string]: any;
        }

      Parameters

      • key: K
      • value: {
            additionalActions?: any;
            annotationIds?: NutrientViewer.Immutable.List<string>;
            canSetGroup?: boolean;
            group?: null | string;
            id?: string;
            isDeletable?: boolean;
            isEditable?: boolean;
            isFillable?: boolean;
            label?: string;
            name?: string;
            noExport?: boolean;
            pdfObjectId?: null | number;
            readOnly?: boolean;
            required?: boolean;
            [key: string]: any;
        }[K]

      Returns this

    • Parameters

      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 {
          additionalActions?: any;
          annotationIds?: any;
          canSetGroup?: any;
          group?: any;
          id?: any;
          isDeletable?: any;
          isEditable?: any;
          isFillable?: any;
          label?: any;
          name?: any;
          noExport?: any;
          pdfObjectId?: any;
          readOnly?: any;
          required?: any;
          [key: string]: any;
      }

    • Shallowly converts this Record to equivalent native JavaScript Object.

      Returns {
          additionalActions?: any;
          annotationIds?: NutrientViewer.Immutable.List<string>;
          canSetGroup?: boolean;
          group?: null | string;
          id?: string;
          isDeletable?: boolean;
          isEditable?: boolean;
          isFillable?: boolean;
          label?: string;
          name?: string;
          noExport?: boolean;
          pdfObjectId?: null | number;
          readOnly?: boolean;
          required?: boolean;
          [key: string]: any;
      }

    • Shallowly converts this Record to equivalent JavaScript Object.

      Returns {
          additionalActions?: any;
          annotationIds?: NutrientViewer.Immutable.List<string>;
          canSetGroup?: boolean;
          group?: null | string;
          id?: string;
          isDeletable?: boolean;
          isEditable?: boolean;
          isFillable?: boolean;
          label?: string;
          name?: string;
          noExport?: boolean;
          pdfObjectId?: null | number;
          readOnly?: boolean;
          required?: boolean;
          [key: string]: any;
      }

    • Returns Keyed<
          keyof {
              additionalActions?: any;
              annotationIds?: NutrientViewer.Immutable.List<string>;
              canSetGroup?: boolean;
              group?: null | string;
              id?: string;
              isDeletable?: boolean;
              isEditable?: boolean;
              isFillable?: boolean;
              label?: string;
              name?: string;
              noExport?: boolean;
              pdfObjectId?: null | number;
              readOnly?: boolean;
              required?: boolean;
              [key: string]: any;
          },
          any,
      >

    • Type Parameters

      • K extends keyof {
            additionalActions?: any;
            annotationIds?: NutrientViewer.Immutable.List<string>;
            canSetGroup?: boolean;
            group?: null | string;
            id?: string;
            isDeletable?: boolean;
            isEditable?: boolean;
            isFillable?: boolean;
            label?: string;
            name?: string;
            noExport?: boolean;
            pdfObjectId?: null | number;
            readOnly?: boolean;
            required?: boolean;
            [key: string]: any;
        }

      Parameters

      • key: K
      • updater: (
            value: {
                additionalActions?: any;
                annotationIds?: NutrientViewer.Immutable.List<string>;
                canSetGroup?: boolean;
                group?: null | string;
                id?: string;
                isDeletable?: boolean;
                isEditable?: boolean;
                isFillable?: boolean;
                label?: string;
                name?: string;
                noExport?: boolean;
                pdfObjectId?: null | number;
                readOnly?: boolean;
                required?: boolean;
                [key: string]: any;
            }[K],
        ) => {
            additionalActions?: any;
            annotationIds?: NutrientViewer.Immutable.List<string>;
            canSetGroup?: boolean;
            group?: null | string;
            id?: string;
            isDeletable?: boolean;
            isEditable?: boolean;
            isFillable?: boolean;
            label?: string;
            name?: string;
            noExport?: boolean;
            pdfObjectId?: null | number;
            readOnly?: boolean;
            required?: boolean;
            [key: string]: any;
        }[K]

      Returns this

    • Parameters

      • keyPath: Iterable<any>
      • updater: (value: any) => any

      Returns this

    • Returns boolean

      Map#wasAltered

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

      Parameters

      • mutator: (mutable: this) => any

      Returns this

      Map#withMutations