Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Save as custom PDF Presets

Engaged ,
Jun 04, 2015 Jun 04, 2015

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");

TOPICS
Scripting
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Jun 10, 2015 Jun 10, 2015

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

...
Translate
Adobe
Participant ,
Jun 10, 2015 Jun 10, 2015

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 16, 2015 Jun 16, 2015
LATEST

Worked like a charm! Thanks so much Boyd!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines