Copy link to clipboard
Copied
Hi there,
I wish to print in a PDF to use the automatic rotation so that the artboards are printed in one direction (portrait). The PDFs are needed for a RIP.
I figured out the possibility to export (save) as PDF but the solution for the automatic rotation is pretty complicated, so I hope this one is easier.
(Putting a rectangle on top of all at the size of the artboard, group the colliding elements, rotate the group if it's landscape with the center of the rectagle and let the artboard fit to the rectangle afterwands and that's for all artboards, see what I mean?)
Here's the point and the script I am working on. I get a failure-response about embedding fonts but I do not know what's missing as the .ps solution at the bottom works.
What is needed is a PDF-X3 with flattened Transparency, Coated FOGRA 39, Spot Colors to 4C
/* var originalInteractionLevel = userInteractionLevel;
userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS; */
var ordner = 'C://_temp//'; //The PDF sould be written to a absolute Path in the Network of a Windows environment
var dateiNameExt = app.activeDocument.name.split( "." ); //Getting the name of the active Document
var dateiName = dateiNameExt[dateiNameExt.length-2]; //Extract .ai
var druckOptionen = new PrintOptions();
druckOptionen.printPreset = "Netzfeld-test"; //My Print Preset
druckOptionen.PPDName = "Adobe PDF";
druckOptionen.printerName = "Adobe PDF";
var druckJobOptionen = new PrintJobOptions();
druckJobOptionen.name = dateiName;
var dateiPfad = new File (ordner + dateiName + ".pdf"); //Use the document name and the path to save the pdf
druckJobOptionen.file = dateiPfad;
druckOptionen.jobOptions = druckJobOptionen;
//Sone useless stuff I suppose
var fontOpts = new PrintFontOptions();
druckOptionen.fontOptions = fontOpts;
//Set some font options
fontOpts.downloadFonts = PrintFontDownloadMode.DOWNLOADCOMPLETE;
fontOpts.fontSubstitution = FontSubstitutionPolicy.SUBSTITUTETINT;
// Print with options
app.activeDocument.print(druckOptionen);
/* userInteractionLevel = originalInteractionLevel; */
The output I get:
Parts of the printPreset:
The one that works with .ps:
#target illustrator
var originalInteractionLevel = userInteractionLevel;
userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
//Druckvorgabe waehlen.
var druckVorgabe = "druck-test";
//Output ordner für die ps Datei definieren
var ordner = 'C:/_temp/';
var datRef = activeDocument;
//Dateiname extrahieren
var dateiNameExt = datRef.name.split( "." );
var dateiName = dateiNameExt[dateiNameExt.length-2];
//Druckoptionen einstellen
var druckOptionen = new PrintOptions();
//Druckjoboptionen erstellen
var druckJobOptionen = new PrintJobOptions();
druckJobOptionen.name = dateiName;
//Dateipfad konstruiren
var dateiPfad = new File (ordner + dateiName + ".ps");
druckJobOptionen.file = dateiPfad;
druckOptionen.jobOptions = druckJobOptionen;
//Druckvorgabe waehlen
druckOptionen.printPreset = druckVorgabe;
//alert(dateiPfad);
datRef.print(druckOptionen);
userInteractionLevel = originalInteractionLevel;
//Schliessen
/* datRef.close(SaveOptions.DONOTSAVECHANGES); */
Maybe someone of you might help.
Copy link to clipboard
Copied
Why not save as PDF directly ?
//pdfOptionen einstellen
var pdfOptionen = new PDFSaveOptions();
pdfOptionen.pDFXStandard = PDFXStandard.PDFX32003;
//Other PDF options…
datRef.saveAs ( pdfFile, pdfOptionen );
Copy link to clipboard
Copied
The PrintCoordinateOptions are missing in PDFSaveOptions(); especially PrintOrientation.AUTOROTATE. That's what I need for the RIP - all pages must be in portrait-mode. Now I get the files with multiple artboards in portrait and landscape-mode.
At the top of my description I mentioned this in other words. To get this AUTOROTATE feature before save as PDF wouldn't be easy - not impossible, for sure.