Skip to main content
Inspiring
June 6, 2017
Question

Printing in a PDF with Filename - Folder and Filename are ignored

  • June 6, 2017
  • 1 reply
  • 2499 views

With a script for Illustrator I try to make the printing-process for our staff easier. They need to specify different Folders for A4 and A3 PDFs.

First thoughts: I have Illustrator-Files with different Artboard-sizes and Page Orientations. Our RIP does not recognize the document-pages 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 as standard seem to be used first and all the properties in the Script are overwritten. This is the Standard-Setting of the PDF:

This is the 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';

// 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 when I print to PDF: http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/illustrator/sdk/CC2017/Illustrator_JavaScript_Scripting_Reference.pdf

This topic has been closed for replies.

1 reply

Silly-V
Legend
June 6, 2017

var docPath = new File('C://_temp//bla.pdf'); <-- can you try with just one single slash last? 'C://_temp/bla.pdf'

AndyWizzAuthor
Inspiring
June 6, 2017

Thanks for your prompt answer,
I really appreciate this.
I tried this before but it didn't change anything. The complete Filename and Artboards seem to be ignored and the setting from the PDF-Joboption overwrites everything although I haven't set it in the Script.

Inspiring
June 7, 2017

How about set the file path in the "Adobe PDF Setting" to "Documents/*.pdf", print it and then copy and rename the file to desired folder?