Run Acrobat Preflight by Javascript
Posted: Sun Aug 24, 2014 1:08 pm
I have to temporary fix a font embedding issue what happen for an PDF created with the Word configurator in Switch and a Pitstop 12 action list to embed the font subgroups. The document will be shown with empty pages on IOS devices and the preview on OSX will show a corrupted text.
I figured out that the Acrobat XI font embedding preflight will solve my issue.
To fix the issue, I'll add an Acrobat preflight to the flow.
I found some parts in the Acrobat help and it seams to be that the preflight profile will be found. The script will be executed in the command section of the Acrobat configurator.
if(($error == null) && ($doc != null))
{
try
{
var oProfile = Preflight.getProfileByName("Schriften einbetten")
if( oProfile != undefined )
{
var myPreflightResult = this.preflight( oProfile);
if( myPreflightResult.numErrors > 0 ) {
console.println( "Preflight found " + myPreflightResult.numErrors + " Errors.");
} else {
console.println( "Preflight found no Errors.");
}
}
}
catch(theError)
{
$error = theError;
$doc.closeDoc( {bNoSave : true} );
}
}
If I run the preflight interactivly, the font embedding(subgroups) is correct. Running the script above will not change the font embedding. Does anybody have expericene in running preflights from scripts in Switch 12?
Thanks,
Thomas
I figured out that the Acrobat XI font embedding preflight will solve my issue.
To fix the issue, I'll add an Acrobat preflight to the flow.
I found some parts in the Acrobat help and it seams to be that the preflight profile will be found. The script will be executed in the command section of the Acrobat configurator.
if(($error == null) && ($doc != null))
{
try
{
var oProfile = Preflight.getProfileByName("Schriften einbetten")
if( oProfile != undefined )
{
var myPreflightResult = this.preflight( oProfile);
if( myPreflightResult.numErrors > 0 ) {
console.println( "Preflight found " + myPreflightResult.numErrors + " Errors.");
} else {
console.println( "Preflight found no Errors.");
}
}
}
catch(theError)
{
$error = theError;
$doc.closeDoc( {bNoSave : true} );
}
}
If I run the preflight interactivly, the font embedding(subgroups) is correct. Running the script above will not change the font embedding. Does anybody have expericene in running preflights from scripts in Switch 12?
Thanks,
Thomas