data-id=preflight-apis
data-id=id1
Preflight APIs
data-id=preflight
data-id=id2
Preflight
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
Creates a compliance profile for a given PDF standard for the document.
Parameters
cStandardKeyoThermometerapp.thermometer. If oThermometer is not specified, no progress is shown.Valid standard version keys:
- PDF/X-1a:2001
- PDF/X-1a:2003
- PDF/X-3:2002
- PDF/X-3:2003
- PDF/X-4:2008
- PDF/X-4p:2008
- PDF/X-5g:2008
- PDF/X-5n:2008
- PDF/X-5pg:2008
- PDF/A-1a:2005
- PDF/A-1b:2005
- PDF/E-1:2008
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
Retrieves the Nth Preflight profile from the list of installed Preflight profiles.
Parameters
nIndexoThermometerapp.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
Retrieves the number of installed Preflight profiles.
Parameters
oThermometerapp.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
Retrieves the Preflight profile with a specific name from the list of installed Preflight profiles.
Parameters
cNameoThermometerapp.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
Retrieves the Preflight profile with a specific fingerprint of the audit trail. The fingerprint can be acquired from the doc.getPreflightAuditTrail method.
Parameters
cFingerPrintoThermometerapp.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
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
The date and time when the profile was executed.
data-id=78427
data-id=preflight-results
data-id=id12
preflight_results
The result of executing the profile, with four possible values:
- “
Errors“ - “
Warnings“ - “
Info“ - “
Success“
data-id=83215
data-id=preflight-results-description
data-id=id13
preflight_results_description
The descriptive text about the errors.
data-id=16414
data-id=profile-creator
data-id=id14
profile_creator
The software by which the profile was created.
data-id=15765
data-id=profile-creator-version
data-id=id15
profile_creator_version
The version number of the software used for creating the profile.
data-id=15543
data-id=profile-fingerprint
data-id=id16
profile_fingerprint
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
The version number of the format in which the profile was stored.
data-id=88021
data-id=profile-name
data-id=id18
profile_name
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
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
The name of the Preflight profile.
data-id=84619
data-id=description
data-id=description-3
data-id=id22
description
The description of the Preflight profile.
data-id=11020
data-id=hasfixups
data-id=id23
hasFixups
true if the Preflight profile has fixups, false otherwise.
data-id=86085
data-id=haschecks
data-id=id24
hasChecks
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
Checks whether the preflight profile contains a conversion to a specific PDF standard.
Parameters
cVersionValid standard keys:
- PDF/X-1a:2001
- PDF/X-1a:2003
- PDF/X-3:2002
- PDF/X-3:2003
- PDF/X-4:2008
- PDF/X-4p:2008
- PDF/X-5g:2008
- PDF/X-5n:2008
- PDF/X-5pg:2008
- PDF/A-1a:2005
- PDF/A-1b:2005
- PDF/E-1:2008
Returns
true if the specified conversion is configured in the profile, false otherwise.
data-id=73619
data-id=preflightresult
data-id=id27
PreflightResult
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
Indicates the number of errors found in the PDF document.
data-id=42669
data-id=numwarnings
data-id=id30
numWarnings
Indicates the number of warnings found in the PDF document.
data-id=74894
data-id=numinfos
data-id=id31
numInfos
Indicates the number of pieces of information found in the PDF document.
data-id=64789
data-id=numfixed
data-id=id32
numFixed
Indicates the number of successfully applied fixups.
data-id=84811
data-id=numnotfixed
data-id=id33
numNotFixed
Indicates the number of unsuccessfully applied fixups.
data-id=preflightresult-methods
data-id=id34
PreflightResult methods
data-id=report
data-id=id35
report
Creates a Preflight XML report.
Parameters
oThermometerapp.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