data-id=preflight-apis
data-id=id1

Preflight APIs

data-id=preflight
data-id=id2

Preflight

Version (Key)
Save-Prefs
Security
Product
9.0
No
No
Acrobat Pro only

This object represents the Preflight tool.

data-id=preflight-methods
data-id=id3

Preflight methods

data-id=99636
data-id=createcomplianceprofile
data-id=id4

createComplianceProfile

Version (Key)
Save-Prefs
Security
Product
9.0
No
No
Acrobat Pro only

Creates a compliance profile for a given PDF standard for the document.

Parameters

Parameter
Description
cStandardKey
The PDF Standard version to verify.
oThermometer
(optional) Show the status window and the progress bar that indicates to the user that a lengthy operation is in progress. To acquire a Thermometer object, use app.thermometer. If oThermometer is not specified, no progress is shown.

Valid standard version keys:

Returns

A PreflightProfile object. Undefined is returned otherwise.

Example: Check the current PDF document to PDF/A-1b:2005 compliance.

var oProfile = Preflight.createComplianceProfile("PDF/A-1b:2005")
if( oProfile != undefined )
{
   var oThermometer = app.thermometer;
   var myPreflightResult = this.preflight( oProfile, true, oThermometer);
   if( myPreflightResult.numErrors > 0 ) {
       console.println( "PDF document is NOT PDF/A-1b:2005 compliant.");
   } else {
   console.println( "PDF document is PDF/A-1b:2005 compliant.");
   }
}
data-id=20339
data-id=getnthprofile
data-id=id5

getNthProfile

Version (Key)
Save-Prefs
Security
Product
9.0
No
No
Acrobat Pro only

Retrieves the Nth Preflight profile from the list of installed Preflight profiles.

Parameters

Parameter
Description
nIndex
The zero-based index of the profile that should be obtained.
oThermometer
(optional) Shows the status window and the progress bar that indicates to the user that a lengthy operation is in progress. To acquire a Thermometer object, use app.thermometer. If oThermometer is not specified, no progress is shown.

Returns

A PreflightProfile object containing the profile that corresponds to nIndex. Undefined is returned otherwise.

Example: Enumerate through all of the profiles in Preflight.

var num = Preflight.getNumProfiles(app.thermometer);
for( i= 0; i< num; ++i)
{
   var oProfile = Preflight.getNthProfile(i);
   console.println("-----------------------------------------");
   console.println("Name: " + oProfile.name);
   console.println("Comment: " + oProfile.description);
   console.println("HasFixups: " + oProfile.hasFixups);
   console.println("HasChecks: " + oProfile.hasChecks);
   console.println("-----------------------------------------");
}
data-id=30742
data-id=getnumprofiles
data-id=id6

getNumProfiles

Version (Key)
Save-Prefs
Security
Product
9.0
No
No
Acrobat Pro only

Retrieves the number of installed Preflight profiles.

Parameters

Parameter
Description
oThermometer
(optional) Shows the status window and the progress bar that indicates to the user that a lengthy operation is in progress. To acquire a Thermometer object, use app.thermometer. If oThermometer is not specified, no progress is shown.

Returns

The number of installed Preflight profiles.

data-id=26571
data-id=getprofilebyname
data-id=id7

getProfileByName

Version (Key)
Save-Prefs
Security
Product
9.0
No
No
Acrobat Pro only

Retrieves the Preflight profile with a specific name from the list of installed Preflight profiles.

Parameters

Parameter
Description
cName
The name of the profile to be obtained.
oThermometer
(optional) Shows the status window and the progress bar that indicates to the user that a lengthy operation is in progress. To acquire a Thermometer object, use app.thermometer. If oThermometer is not specified, no progress is shown.

Returns

A PreflightProfile object if a profile with the specified name exists. Undefined is returned otherwise.

Example: Get a profile with the name “Magazine Ads”.

var oProfile = Preflight.getProfileByName("Magazine Ads");
if( oProfile != undefined) {
   console.println("-----------------------------------------");
   console.println("Name: " + oProfile.name);
   console.println("Comment: " + oProfile.description);
   console.println("HasFixups: " + oProfile.hasFixups);
   console.println("HasChecks: " + oProfile.hasChecks);
   console.println("-----------------------------------------");
}
data-id=50413
data-id=getprofilebyfingerprint
data-id=id8

getProfileByFingerPrint

Version (Key)
Save-Prefs
Security
Product
9.0
No
No
Acrobat Pro only

Retrieves the Preflight profile with a specific fingerprint of the audit trail. The fingerprint can be acquired from the doc.getPreflightAuditTrail method.

Parameters

Parameter
Description
cFingerPrint
The fingerprint of the profile to be obtained.
oThermometer
(optional) Shows the status window and the progress bar that indicates to the user that a lengthy operation is in progress. To acquire a Thermometer object, use app.thermometer. If oThermometer is not specified, no progress is shown.

Returns

A PreflightProfile object if a profile with the specified fingerprint exists. Undefined is returned otherwise.

Example: Get a profile from the audit trail.

var oAuditTrail = this.getPreflightAuditTrail();
var oProfile = Preflight.getProfileByFingerPrint(oAuditTrail.profile_fingerprint);
if( oProfile != undefined) {
   console.println("-----------------------------------------");
   console.println("Name: " + oProfile.name);
   console.println("Comment: " + oProfile.description);
   console.println("HasFixups: " + oProfile.hasFixups);
   console.println("HasChecks: " + oProfile.hasChecks);
   console.println("-----------------------------------------");
}
data-id=72375
data-id=preflightaudittrail
data-id=id9

PreflightAuditTrail

Version (Key)
Save-Prefs
Security
Product
9.0
No
No
Acrobat Pro only

A PreflightAuditTrail represents information about a Preflight check that has been carried out for the PDF, and contains information about the Preflight profile used as well as what the outcome of the Preflight check was.

data-id=preflightaudittrail-properties
data-id=id10

PreflightAuditTrail properties

data-id=21621
data-id=preflight-executed-date
data-id=id11

preflight_executed_date

Version (Key)
Save-Prefs
Security
Product
Type
Access
9.0
No
No
Acrobat Pro only
String
R

The date and time when the profile was executed.

data-id=78427
data-id=preflight-results
data-id=id12

preflight_results

Version (Key)
Save-Prefs
Security
Product
Type
Access
9.0
No
No
Acrobat Pro only
String
R

The result of executing the profile, with four possible values:

data-id=83215
data-id=preflight-results-description
data-id=id13

preflight_results_description

Version (Key)
Save-Prefs
Security
Product
Type
Access
9.0
No
No
Acrobat Pro only
String
R

The descriptive text about the errors.

data-id=16414
data-id=profile-creator
data-id=id14

profile_creator

Version (Key)
Save-Prefs
Security
Product
Type
Access
9.0
No
No
Acrobat Pro only
String
R

The software by which the profile was created.

data-id=15765
data-id=profile-creator-version
data-id=id15

profile_creator_version

Version (Key)
Save-Prefs
Security
Product
Type
Access
9.0
No
No
Acrobat Pro only
String
R

The version number of the software used for creating the profile.

data-id=15543
data-id=profile-fingerprint
data-id=id16

profile_fingerprint

Version (Key)
Save-Prefs
Security
Product
Type
Access
9.0
No
No
Acrobat Pro only
String
R

The fingerprint for the profile that was used to carry out the Preflight check.

data-id=84437
data-id=profile-format-version
data-id=id17

profile_format_version

Version (Key)
Save-Prefs
Security
Product
Type
Access
9.0
No
No
Acrobat Pro only
String
R

The version number of the format in which the profile was stored.

data-id=88021
data-id=profile-name
data-id=id18

profile_name

Version (Key)
Save-Prefs
Security
Product
Type
Access
9.0
No
No
Acrobat Pro only
String
R

The name of the Preflight profile used.

Example: Display the properties from the audit trail.

var oAuditTrail = this.getPreflightAuditTrail();
if( oAuditTrail != undefined) {
   var oProfile = Preflight.getProfileByFingerPrint(oAuditTrail.profile_fingerprint);
   if( oProfile != undefined) {
       console.println("-----------------------------------------");
       console.println("Name: " + oAuditTrail.profile_name);
       console.println("Creator: " + oAuditTrail.profile_creator);
       console.println("Creator Version: " + oAuditTrail.profile_creator_version);
       console.println("Format Version: " + oAuditTrail.profile_format_version);
       console.println("Results: " + oAuditTrail.preflight_results);
       console.println("Description: " + oAuditTrail.preflight_results_description);
       console.println("Executed Date: " + oAuditTrail.preflight_executed_date);
       console.println("Fingerprint: " + oAuditTrail.profile_fingerprint);
       console.println("-----------------------------------------");
   } else {
       this.removePreflightAuditTrail();
   }
}
data-id=83635
data-id=preflightprofile
data-id=id19

PreflightProfile

Version (Key)
Save-Prefs
Security
Product
9.0
No
No
Acrobat Pro only

A PreflightProfile represents a particular Preflight profile; that is a Preflight profile that is installed in the Preflight tool. The PreflightProfile object can be acquired from Preflight.getNthProfile, Preflight.getProfileByName, Preflight.createComplianceProfile or Preflight.getProfileByFingerPrint.

data-id=preflightprofile-properties
data-id=id20

PreflightProfile properties

data-id=63688
data-id=name
data-id=name-20
data-id=id21

name

Version (Key)
Save-Prefs
Security
Product
Type
Access
9.0
No
No
Acrobat Pro only
String
R

The name of the Preflight profile.

data-id=84619
data-id=description
data-id=description-3
data-id=id22

description

Version (Key)
Save-Prefs
Security
Product
Type
Access
9.0
No
No
Acrobat Pro only
String
R

The description of the Preflight profile.

data-id=11020
data-id=hasfixups
data-id=id23

hasFixups

Version (Key)
Save-Prefs
Security
Product
Type
Access
9.0
No
No
Acrobat Pro only
Boolean
R

true if the Preflight profile has fixups, false otherwise.

data-id=86085
data-id=haschecks
data-id=id24

hasChecks

Version (Key)
Save-Prefs
Security
Product
Type
Access
9.0
No
No
Acrobat Pro only
Boolean
R

true if the Preflight profile has checks, false otherwise.

data-id=preflightprofile-methods
data-id=id25

PreflightProfile methods

data-id=hasconversion
data-id=id26

hasConversion

Version (Key)
Save-Prefs
Security
Product
9.0
No
No
Acrobat Pro only

Checks whether the preflight profile contains a conversion to a specific PDF standard.

Parameters

cVersion
The PDF standard, represented as a string.

Valid standard keys:

Returns

true if the specified conversion is configured in the profile, false otherwise.

data-id=73619
data-id=preflightresult
data-id=id27

PreflightResult

Version (Key)
Save-Prefs
Security
Product
9.0
No
No
Acrobat Pro only

A PreflightResult represents a particular Preflight result; it is a data structure created by the Preflight tool. The PreflightResult object can be acquired from the doc.preflight method.

data-id=preflightresult-properties
data-id=id28

PreflightResult properties

data-id=89206
data-id=numerrors
data-id=id29

numErrors

Version (Key)
Save-Prefs
Security
Product
Type
Access
9.0
No
No
Acrobat Pro only
Integer
R

Indicates the number of errors found in the PDF document.

data-id=42669
data-id=numwarnings
data-id=id30

numWarnings

Version (Key)
Save-Prefs
Security
Product
Type
Access
9.0
No
No
Acrobat Pro only
Integer
R

Indicates the number of warnings found in the PDF document.

data-id=74894
data-id=numinfos
data-id=id31

numInfos

Version (Key)
Save-Prefs
Security
Product
Type
Access
9.0
No
No
Acrobat Pro only
Integer
R

Indicates the number of pieces of information found in the PDF document.

data-id=64789
data-id=numfixed
data-id=id32

numFixed

Version (Key)
Save-Prefs
Security
Product
Type
Access
9.0
No
No
Acrobat Pro only
Integer
R

Indicates the number of successfully applied fixups.

data-id=84811
data-id=numnotfixed
data-id=id33

numNotFixed

Version (Key)
Save-Prefs
Security
Product
Type
Access
9.0
No
No
Acrobat Pro only
Integer
R

Indicates the number of unsuccessfully applied fixups.

data-id=preflightresult-methods
data-id=id34

PreflightResult methods

data-id=report
data-id=id35

report

Version (Key)
Save-Prefs
Security
Product
9.0
No
No
Acrobat Pro only

Creates a Preflight XML report.

Parameters

Parameter
Description
oThermometer
(optional) Shows the status window and the progress bar that indicates to the user that a lengthy operation is in progress. To acquire a Thermometer object, use app.thermometer. If oThermometer is not specified, no progress is shown.

Returns

A string containing the XML report. This string can be used with XMLData.parse method to create an XFA object that represents either a tree headed by a single node or a tree started by a list of nodes (a tree list).

Example: Create and parse a Preflight XML report.

var oProfile = Preflight.getProfileByName("Magazine Ads")
if( oProfile != undefined )
{
   var oThermometer = app.thermometer;
   var myPreflightResult = this.preflight( oProfile, false, oThermometer);
   if( myPreflightResult.numErrors > 0 ) {
   var cXMLData = myPreflightResult.report(oThermometer);
   var oXMLData = XMLData.parse(sXMLData, false);
   // .
  .. do something with XMLData object ...
}
data-id=43354