2 Replies Latest reply on Jun 16, 2015 5:03 AM by subieguy2

    Save as custom PDF Presets

    subieguy2 Level 1

      I have a document that I want to save the .ai file that is open....then save as a pdf with my own Adobe PDF Presets. The name of my preset is:     Machine Views

       

      Example sudo code:

       

      #target illustrator
      var doc = app.activeDocument;
      // just save it as the .ai that it is
      doc.save();
      // save .ai as .pdf with custom named preset
      doc.savePDF("Machine Views");
      
        • 1. Re: Save as custom PDF Presets
          aiScripting Level 1

          Hello subieguy2

           

          Try this

          #target illustrator
          
          
          var doc = app.activeDocument; // get the active document
                  
                  // set up the pdf save options
                  var pdfOptions = new PDFSaveOptions();
                      pdfOptions.pDFPreset = "Machine Views";
                  
                  // set up the ai save options
                  var aiOptions = new IllustratorSaveOptions()
                      aiOptions.compatibility = Compatibility.ILLUSTRATOR8;//change this to what ever version of ai you want to save it as
          
          
          // create the save folder object   
          var myFolder = Folder([folderpath]); // Set the folder path where you want to save the files
          
          
          // Create the ai File object
          var aiFile = new File(myFolder + [filename] + ".ai"); 
          
          
          // create the pdf File object
          var pdfFile = new File(myFolder + [filename] + ".pdf");
          
          
          //save the ai file
          doc.saveAs (aiFile, aiOptions);
          
          
          // save the pdf file
          doc.saveAs (pdfFile, pdfOptions);
          

           

          Hope that helps!

          -Boyd

          • 2. Re: Save as custom PDF Presets
            subieguy2 Level 1

            Worked like a charm! Thanks so much Boyd!