ComPDFKit Web SDK
    Preparing search index...

    Class FieldManager

    Manages the form fields of the document; fields group the widgets that share a field name.

    Index
    • Adds a field; it is kept even when it has no widgets.

      Parameters

      • field: Field

        The field to add.

      Returns void

    • All required (Required) fields have values (neither an empty string nor 'Off').

      Returns boolean

    • Turns off widget highlighting and fires widgetHighlightingChanged.

      Returns void

    • Highlights fillable widgets (except buttons) on screen and fires widgetHighlightingChanged.

      Returns void

    • Gets the calculation order of fields (/AcroForm /CO). Only stored; calculations are not run.

      Returns string[]

      Field names in calculation order.

    • Gets a field by its fully qualified name.

      Parameters

      • name: string

        The field name.

      Returns Field | null

      The field, or null when not found.

      const { annotationManager } = instance.Core;
      const fieldManager = annotationManager.getFieldManager();
      const field = fieldManager.getField('address.city');
      if (field)
      console.log(field.getValue());
    • Gets all fields.

      Returns Field[]

      The fields.

      const { annotationManager } = instance.Core;
      for (const field of annotationManager.getFieldManager().getFields())
      console.log(field.name, field.getFieldType(), field.getValue());
    • Fields of this user (Field.getUser equals it).

      Parameters

      • user: string

      Returns Field[]

    • Gets a field by name, creating and adding it when it does not exist.

      Parameters

      • name: string

        The field name.

      • type: string

        Field type of a new field: 'Tx', 'Btn', 'Ch' or 'Sig'.

      Returns Field

      The existing or new field.

    • Whether fillable widgets are highlighted.

      Returns boolean

      True when highlighting is on (the default).

    • Goes to the page of the field's first widget and centers it (does nothing without widgets); options as in AnnotationManager#jumpToAnnotation.

      Parameters

      • field: Field
      • Optionaloptions: JumpOptions

      Returns void

    • Form script alert boxes go to it (window.alert when unset).

      Parameters

      • handler: ((message: string) => void) | null

      Returns void

    • Written to /AcroForm /CO on save (field names not in the file are removed), and as when exporting XFDF.

      Parameters

      • order: string[]

      Returns void

    • The named action Print and form script printing go to it (only a warning is logged when unset).

      Parameters

      • handler: (() => void) | null

      Returns void

    • Renames a field: the widgets' fieldName changes too and is committed; joins an existing field with the new name if there is one.

      Parameters

      • field: Field
      • name: string

      Returns void