2 Replies Latest reply on May 19, 2017 9:04 AM by AndyWizz

    Illustrator: Printing in a PDF with printPreset

    AndyWizz Level 1

      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:

      2017-05-19 (7).png

      Parts of the printPreset:

      printPDF.png

       

      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);
      //Drucken 
      datRef.print(druckOptionen);
      
      userInteractionLevel = originalInteractionLevel;
      //Schliessen 
      /* datRef.close(SaveOptions.DONOTSAVECHANGES); */
      

       

      Maybe someone of you might help.