Mobile app version of vmapp.org
Login or Join
Murray664

: Scripting JS for Illustrator - PrintJobOptions are ignored, JobOptions first, missing Filename with a script for Illustrator I try to make the printing-process for our staff easier. First thoughts:

@Murray664

Posted in: #AdobeIllustrator #Javascript #PhotoshopScripting #PrintDesign #Script

with a script for Illustrator I try to make the printing-process for our staff easier.

First thoughts:
I have Illustrator-Files with different Artboard-sizes and Page Orientations. Our RIP does not recognize the document being A4 or A3. So I have to split the File in at least two PDFs, one is A4, one is A3. All of them must be in Portrait-Mode so that A4 and A3 is used completely.
Printing in a PDF (Windows workflow) works with PrintOrientation set to AUTOROTATE. Rotating the artboards with all Objects and save as PDF would be great but I figured out it's pretty complicated. So I would like to go on with printing in a PDF and using the Autorotate feature.

Where I am stuck:
The filename and the printJobOptions seem to be ignored.
I need to specify the path of the filename and the Media-Size but the PDF-Settings of the virtual PDF-Printer I am using seem to be used first and all the properties in the Script are overwritten.
This is the Standard-Setting of the PDF:


Here is my Script so far:
#target Illustrator #targetengine main

/*
var originalInteractionLevel = userInteractionLevel;
userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
*/

var docRef = app.activeDocument;
var options = new PrintOptions();

/* printJobOptions.printPreset = 'Netzfeld-test'; */

// Printer
options.printerName = 'Adobe PDF';
options.PPDName = 'Adobe PDF';

// Fonts
var fontOpts = new PrintFontOptions();
fontOpts.downloadFonts = PrintFontDownloadMode.DOWNLOADCOMPLETE;
fontOpts.fontSubstitution = FontSubstitutionPolicy.SUBSTITUTETINT;
options.fontOptions = fontOpts;

// Color
var colorOptions = new PrintColorManagementOptions();
colorOptions.intent = PrintColorIntent.RELATIVECOLORIMETRIC;
colorOptions.colorProfileMode = PrintColorProfile.CUSTOMPROFILE;
colorOptions.name = "Coated FOGRA39 (ISO 12647-2:2004)";
options.colorManagementOptions = colorOptions;

// Seperation
var sepOptions = new PrintColorSeparationOptions();
sepOptions.convertSpotColors = true;
sepOptions.overPrintBlack = true;
sepOptions.colorSeparationMode = PrintColorSeparationMode.COMPOSITE;
sepOptions.colorProfileMode = PrintColorProfile.SOURCEPROFILE;
options.colorSeparationOptions = sepOptions;

// Print Coordinates
var coordinateOptions = new PrintCoordinateOptions();
coordinateOptions.emulsion = false; // reverse from right to left
coordinateOptions.fitToPage = false; // fit artwork to page size
coordinateOptions.position = PrintPosition.TRANSLATECENTER;
coordinateOptions.orientation = PrintOrientation.AUTOROTATE;
options.coordinateOptions = coordinateOptions;

// Filename and Artboards are ignored
var printJobOptions = new PrintJobOptions();
options.printJobOptions = printJobOptions;

// Filename
var docPath = new File('C://_temp//bla.pdf');
printJobOptions.file = docPath;

// Artboards
printJobOptions.designation = PrintArtworkDesignation.VISIBLEPRINTABLELAYERS;
printJobOptions.printArea = PrintingBounds.ARTBOARDBOUNDS;
printJobOptions.collate = true;
printJobOptions.printAllArtboards = false;
printJobOptions.artboardRange = '1';
/*
PDFSaveOptions.printAllArtboards = false;
PDFSaveOptions.artboardRange = '1';
PDFSaveOptions.compatibility = PDFCompatibility.ACROBAT4;
*/
// Print
docRef.print(options);
/*
userInteractionLevel = originalInteractionLevel;
*/


What's wrong with it? What's missing?
The example in the Scripting Manual of Illustrator on page 176 doesn't seem to work either:
Scripting Manual of Illustrator CC2017

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Murray664

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme