XFA

6.0.2

 

 

 

The XFA object provides access to the XFA appModel container. More detailed information is available in Developing Acrobat Applications Using JavaScript. Additional XFA documentation is available through the XML section of the Acrobat Developer Center.

An XFA object is returned by the XMLData.parse and XMLData.applyXPath methods.

Example

The following code detects whether the PDF document has Acrobat forms or was created by LiveCycle Designer and has XML forms. The script can be run in the console, or as a batch sequence; in the latter case, the script can be used to classify all selected document as an XML form (dynamic or static) or as an Acrobat form.

   // This script assumes you are using Acrobat 8.0.

   console.println("Document name: " + this.documentFileName);

   // The xfa object is undefined in an Acrobat form.

   if ( typeof xfa == "object" ) {

      if ( this.dynamicXFAForm )

         console.println("  This is a dynamic XML form.");

      else

         console.println("  This is a static XML form.");

      if ( this.XFAForeground )

         console.println("  This document has imported artwork");

   }

   else console.println("  This is an Acrobat form.");