Hi Peter, You can generate the report if error found. Please see below code: var myDocument=app.activeDocument; var profile = app.preflightProfiles.add(); profile.name = "Test"; profile.description = "Test description"; const RULE_NAME = "ADBE_PageSizeOrientation"; var rule = profile.preflightProfileRules.add(RULE_NAME); //Requires the page size to be 8.5 in x 11in (Letter Size) // //enters a value for tolerance rule.ruleDataObjects.add("tolerance", RuleDataType.realDataType, 0.01); //Sets the width to the point equivalent of 8.5 inches rule.ruleDataObjects.add("width", RuleDataType.realDataType, 612); // Sets the width to the point equivalent of 11 inches rule.ruleDataObjects.add("height", RuleDataType.realDataType, 792); //true = ignore orientation is checked rule.ruleDataObjects.add("ignore_orientation", RuleDataType.booleanDataType, true); //set the rule to return an error rule.flag = PreflightRuleFlag.returnAsError; //Process the doc with the rule var process = app.preflightProcesses.add(myDocument, profile); process.waitForProcess(); results = process.processResults; //If Errors were found if (results != 'None') { //Export the file to PDF //The “true” value selects to open the file after export. process.saveReport(File("~/Desktop/preflight.pdf"), true); } Shonky
... View more