Adobe 27510753 Scripting Guide - Page 141
To print a document using a printer preset, include the printer preset in the print method,
UPC - 718659445294
View all Adobe 27510753 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 141 highlights
Adobe InDesign CS2 Scripting Guide Working with Documents in JavaScript 133 profile = Profile.postscriptCMS; } catch(e){} Properties corresponding to the controls in the Advanced panel of the //Print dialog box opiImageReplacement = false; omitBitmaps = false; omitEPS = false; omitPDF = false; //The following line assumes that you have a flattener preset named "high quality flattener". try{ flattenerPresetName = "high quality flattener"; } catch(e){} ignoreSpreadOverrides = false; } Using printer presets To print a document using a printer preset, include the printer preset in the print method: //PrintDocumentWithPreset.jsx //An InDesign CS2 JavaScript //Prints the active document using the specified printer preset. //Assumes you have a printer preset named "myPreset" and that a document is open. app.activeDocument.print(false, app.printerPresets.item("myPreset")); Creating printer presets from printing preferences To create a printer preset from the print preferences of a document: //CreatePrinterPreset.jsx //An InDesign CS2 JavaScript //Creates a new printer preset. //If the preset does not already exist, then create it; //otherwise, fill in the properties of the existing preset. var myPreset; myPreset = app.printerPresets.item("myPreset"); try{ myPreset.name; } catch(myError){ myPreset = app.printerPresets.add({name:"myPreset"}); } with(app.activeDocument.printPreferences){ //Because many printing properties are dependent on other printing properties, //we've surrounded each property-setting line with try...catch statements-//these will make it easier for you to experiment with print preset settings. try{ myPreset.printer = printer; } catch(e){} try{ myPreset.ppd = ppd; } catch(e){} try{ myPreset.copies = copies; }