2   Forms Support and JavaScript

Forms in PDF are a critical part of the PDF ecosystem. Fortune 500 companies and governments around the world have adopted and standardized on using PDF forms technology, and built this functionality into their critical workflows.

2.1   AcroForms

Most Acroform elements and their properties are supported. Note the following:

  • The submit type email is the only supported submit type.
  • Barcodes are not supported.

2.2   FormsCentral

Most Forms Central form elements are supported. Note the following:

  • The only supported submit types are http actions and email.

2.3   XFA (dynamic) forms

Unsupported. While Reader Mobile does support Acroforms (forms created by Acrobat’s form tools), it currently does not support the XFA forms created with LiveCycle Designer. Some forms can be filled in and will appear to work, but when you open the forms on another viewer (such as Acrobat), the data isn’t there.

2.4   Supported JavaScript APIs

From the beginning, forms have provided not only a vehicle for data entry, but also field format and data validation, computation, and submission. For all of these behaviors, the PDF Forms technology relies on JavaScript.

Adobe Acrobat defines a set of custom JavaScript objects which deal with specifics of the Acrobat Viewer and PDF documents. These custom JavaScript objects collectively form the Acrobat Document Object Model (DOM) which allow client-side JavaScripts to directly interact with the program and documents. JavaScript documentation resides at http://www.adobe.com/devnet/acrobat/javascript.html.

For Reader Mobile, the initial JavaScript support includes performing BUILT-IN forms calculations, data validation, and data formatting. The JavaScript framework is general enough to support other JavaScript APIs in future and is expected to regularly evolve.

The following Acrobat Javascript APIs are implemented in Reader Mobile 10.3 except as noted.

2.4.1   app Object

Properties

  • 10.5.2: platform: The platform that the script is currently executing on. Valid values are iOS and Android.
  • 10.5.2: language: The language of the running Reader application.

Methods

alert(): Support for the parameter cMsg. Both cMsg and nIcon are required, but nIcon is ignored.

For details, see the JavaScript Reference.

2.4.2   Doc Object

Methods

getField():

  • 10.3: Fully supported except for creating field objects using a naming hierarchy. The getField API takes a field name as parameter and returns a Field object. As long as the field name is a flat name, this API will work.

  • 10.4: Added support for creating field objects using a naming hierarchy.

  • 10.5: Methods:

    • resetForm(): All paramaters are ignored all form fields are reset.

    • submitForm(): Implemented to support FormsCentral forms only.

      • cURL: The URL to submit to. Value must begin with “https://adobeformscentral.com”.
      • cSubmitAs: Indicates the format for submission. Value must be “HTML”.
      • cCharset: The encoding for the values submitted. This parameter must be passed but we ignore its value.

For details, see the JavaScript Reference.

2.4.3   event Object

Properties

Reader Mobile supports a subset of the event properties as follows:

  • change: R/W access
  • value: R/W access
  • selStart: R access
  • selEnd: R access
  • rc: R/W access
  • willCommit: R access
  • 10.5: target: R access (available only when Field event is being executed)

For details, see the JavaScript Reference.

Forms events

Reader Mobile supports a subset of the forms events as follows:

  • Field/Keystroke
  • Field/Validate
  • Field/Calculate
  • Field/Format

For details, see the JavaScript Reference.

2.4.4   Field Object

Properties

  • value: Read access
  • 10.5: value: Write access

Methods

  • 10.4: getField()
  • 10.5: setFocus(): Fully supported.

For details, see the JavaScript Reference.

2.4.5   util Object

Methods

Reader Mobile supports a subset of the util methods as follows:

  • printd(): The methods takes three parameters; however, bXFAPicture is ignored.
  • printf(): Fully supported.
  • printx(): Fully supported.

For details, see the JavaScript Reference.