Skip to content

IPdfField

Definition

typescript
export interface IPdfField {
  /**
   * true if the field is an XFA field, false if it is a classic PDF field
   */
  isXfa: boolean;
  fieldType:
    | 'CheckBoxField'
    | 'TextField'
    | 'RadioButtonField'
    | 'ListBoxField'
    | 'DropDownListField'
    | 'PushButtonField'
    | 'SignatureField'
    | 'PasswordField'
    | 'DateTimeField'
    | 'NumericField'
    | 'UnknownField';
  /** The field's full name (unique identifier) */
  fullName: string;
  /** true if the field is read-only */
  readOnly: boolean;
  /**
   * The `requiredMode` may have one of the following values:
   *
   * - 0: Optional
   * - 1: Recommended (note: this setting cannot be used in classic PDF documents)
   * - 2: Required
   */
  requiredMode: number;
  /**
   * The field's value.
   *
   * Note that all field values are expressed as a string, even if the underlying
   * type of the field is numeric.  The string will be converted to the appropriate type.
   */
  value: string;
  /** XFA actions associated with a field
   *
   * `xfaActions` returns an array of `XfaActionModel` objects, one for each action with a non-empty script.
   * Each `XfaActionModel` contains two strings:
   *
   * - the `Activity` which triggers the action, and
   * - the `Script` which will be executed.
   *
   * Valid activities are:
   *
   * | Activity          | Description                   |
   * | ----------------- | ----------------------------- |
   * | "Click"           | Occurs when the user clicks in the field. Most systems define click as pressing and releasing the mouse button while not moving the pointer beyond a very small threshold.|
   * | "Initialize"      | Occurs after data binding is complete. A separate event is generated for each instance of the field in the Form DOM.|
   * | "IndexChange"     | Occurs whenever the instance manager for a variable-occurrence object initially adds an instance or changes the instance number of an existing instance. The event is received only by the affected instances.|
   * | "Enter"           | For a field, occurs when the field gains keyboard focus. For a subform or exclusion group, occurs when some field within the subform or exclusion group gains keyboard focus, that is, keyboard focus moves from outside the object to inside it.|
   * | "Exit"            | For a field, occurs when the field loses keyboard focus. For a subform or exclusion group, occurs when all fields within the subform or exclusion group lose keyboard focus, that is, focus moves from inside the object to outside it.|
   * | "MouseEnter"      | Occurs when the user drags the mouse pointer over the field without necessarily pressing the button.|
   * | "MouseExit"       | Occurs when the user drags the mouse pointer out of the field without necessarily pressing the button.|
   * | "Change"          | Occurs when the user changes the field value. This will occur with each key-stroke, when text is pasted, when a new choice is selected, when a check button is clicked, and so on.|
   * | "PreSave"         | Occurs just before the form data is written out in PDF or XDP format. Does not occur when the Data DOM or some other subset of the form is exported to XDP. XSLT postprocessing, if enabled, occurs after this event.|
   * | "PostSave"        | Occurs just after the form has been written out in PDF or XDP format. Does not occur when the Data DOM or some other subset of the form is exported to XDP.|
   * | "PrePrint"        | Occurs just prior to rendering for print.|
   * | "PostOpen"        | Occurs after a drop-down choice list is displayed, or an attempt has been made to display one, provided the choice list has its open property set to userControl or onEntry.|
   * | "PostPrint"       | Occurs just after the rendered form has been sent to the printer, spooler, or output destination.|
   * | "PostSign"        | Occurs after a signature is applied or an attempt to apply a signature has failed.|
   * | "PreSign"         | Occurs before a signature is applied. A script triggered by this event has a chance to change content and field access rights (e.g. making fields read-only) before the signature is applied.|
   * | "PostSubmit"      | Occurs when data is sent to the host via a submit operation, just after the returned data has been marshalled in a connectionData element underneath $datasets but before the returned data is merged back into the Data DOM. A script triggered by this event has the chance to examine and alter the data before it is re-merged. If the script is marked to be run only at the server, the data is sent to the server with an indication that it should run the associated script before returning the resulting data.|
   * | "Ready"           | Occurs when the DOM has finished loading.|
   * | "DocReady"        | Occurs before the document is rendered but after data binding. It comes after the ready event associated with the Form DOM.|
   * | "DocClose"        | Occurs at the very end of processing if and only if all validations succeeded. Success in this case is defined as generating nothing worse than a warning (no errors). Note that this event comes too late to modify the saved document; it is intended to be used for generating an exit status or completion message.|
   * | "MouseUp"         | Occurs when the user releases the mouse button in the field.|
   * | "MouseDown"       |  Occurs when the user presses the mouse button in the field, but before the button is released.|
   * | "Full"            | Occurs when the user has entered the maximum allowed amount of content into the field.|
   * | "PreSubmit"       | Occurs when data is sent to the host via a submit operation, just after the data has been marshalled in a connectionData element underneath $datasets but before the data is submitted to the host. A script triggered by this event has the chance to examine and alter the data before it is submitted. If the script is marked to be run only at the server, the data is sent to the server with an indication that it should run the associated script before performing the rest of the processing.|
   * | "PreExecute"      | Occurs when a request is sent to a web service via WSDL, just after the data has been marshalled in a connectionData element underneath $datasets but before the request has been sent. A script triggered by this event has the chance to examine and alter the data before the request is sent. If the script is marked to be run only at the server, the data is sent to the server with an indication that it should run the associated script before performing the rest of the processing.|
   * | "PostExecute"     | Occurs when data is sent to a web service via WSDL, just after the reply to the request has been received and the received data is marshalled in a connectionData element underneath $datasets. A script triggered by this event has the chance to examine and process the received data. After execution of this event the received data is deleted.|
   * | "PreOpen"         | Occurs before a drop-down choice list opens, provided the choice list has its open property set to userControl or onEntry. Typically used to populate the drop-down list dynamically.|
   * | "ValidationState" | Occurs whenever the validation state of the target changes. The validation state is considered to change when it transitions from a valid to an invalid state or from an invalid to a valid state. It is also considered to change when it is still invalid but a different validation test fails than failed previously, for example if the target fails the format test whereas previously it failed the null test.|
   *
   */
  xfaActions: { script: string; activity: string }[] | null;
  /** value of a selected checkbox */
  checkBoxOnValue?: string;
  /** value of an unselected checkbox */
  checkBoxOffValue?: string;
  listOptions: ListOptionModel[] | null;
  radioButtonOptions: string[] | null;
  multiLine: boolean;
}