-
saitok
- Member
- Posts: 63
- Joined: Fri Apr 24, 2015 10:14 am
- Location: Tokyo Japan
Post
by saitok »
Hi,
I want to do Acrobat Preflight using Switch because of this.
viewtopic.php?f=18&t=2342
I found the following JavaScript on the Web.
I can execute the specified Preflight Profile, and save the PDF outside of the Switch.
But I can't understand how can I save the PDF inside of the Switch.
I need the link between the Job and the Ticket and Metadata.
Could anyone help me?
Code: Select all
var oProfile = Preflight.getProfileByName("EmbedFlagCheck")
if( oProfile != undefined )
{
var oThermometer = app.thermometer;
var myPreflightResult = $doc.preflight( oProfile, false, oThermometer);
if( myPreflightResult.numErrors > 0 )
{
$doc.saveAs("/Users/saitou_k/Desktop/NG.pdf");
}
else
{
$doc.saveAs("/Users/saitou_k/Desktop/OK.pdf");
}
}
-
saitok
- Member
- Posts: 63
- Joined: Fri Apr 24, 2015 10:14 am
- Location: Tokyo Japan
Post
by saitok »
Finally, I make this.
How do you feel...?
Code: Select all
var oProfile = Preflight.getProfileByName("EmbedFlagCheckTT")
if( oProfile != undefined )
{
var oThermometer = app.thermometer;
var myPreflightResult = $doc.preflight( oProfile, false, oThermometer);
if( myPreflightResult.numErrors > 0 )
{
$doc.saveAs($outfolder + "/" + $filename + "_x.pdf");
$outfiles = [];
$outfiles.push($outfolder + "/" + $filename + "_x.pdf");
}
else
{
$doc.saveAs($outfolder + "/" + $filename + "_o.pdf");
$outfiles = [];
$outfiles.push($outfolder + "/" + $filename + "_o.pdf");
}
}