Copy link to clipboard
Copied
I'm sure this is something simple, but I'm not accustomed to working with book preflight options, but I cannot get the following code to generate the preflight report.
book.preflight(new File(outFol.fsName + "/" + outFileName + "-preflight.pdf"), true);
I know the path is good, because I am exporting a pdf of the book right after it successfully. I've tried setting the file to txt but no go either. Do I need to do something with the preflightBookOptions? Thanks.
Edit: I came across this thread, in which Jongware suggests you have to set the working profile. I've tried amending my code as such, but still no bites. I've tried without the profilePolicy and scope.
Any help would be appreciated.
var outFileName = book.name.replace(".indb","");
var pbo = book.preflightBookOptions;
var prefFile = File(outFol.fsName + "/" + outFileName + "-preflight.pdf");
pbo.preflightProfilePolicy = PreflightProfileOptions.USE_WORKING_PROFILE;
pbo.preflightWorkingProfile = app.preflightProfiles.lastItem();
pbo.preflightScope = PreflightScopeOptions.PREFLIGHT_ALL_DOCUMENTS;
book.preflight(prefFile, false);
Copy link to clipboard
Copied
I'm sure this is something simple, but I'm not accustomed to working with book preflight options, but I cannot get the following code to generate the preflight report.
book.preflight(new File(outFol.fsName + "/" + outFileName + "-preflight.pdf"), true);
I know the path is good, because I am exporting a pdf of the book right after it successfully. I've tried setting the file to txt but no go either. Do I need to do something with the preflightBookOptions? Thanks.
Edit: I came across this thread, in which Jongware suggests you have to set the working profile. I've tried amending my code as such, but still no bites. I've tried without the profilePolicy and scope.
Any help would be appreciated.
var outFileName = book.name.replace(".indb","");
var pbo = book.preflightBookOptions;
var prefFile = File(outFol.fsName + "/" + outFileName + "-preflight.pdf");
pbo.preflightProfilePolicy = PreflightProfileOptions.USE_WORKING_PROFILE;
pbo.preflightWorkingProfile = app.preflightProfiles.lastItem();
pbo.preflightScope = PreflightScopeOptions.PREFLIGHT_ALL_DOCUMENTS;
book.preflight(prefFile, false);
Have something to add?