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

Create PDF 2 time larger

Explorer ,
Oct 06, 2023 Oct 06, 2023

Copy link to clipboard

Copied

After I write codes then I create PDF file , PDF file that is created almost 2 times larger than then PDF I created manually. You can find below details of PDF I created manually. How can I create the PDF like manually created size ? Thank you

 

var doc = app.activeDocument;
function pdfExport() {
    if (app.documents.length > 0) {
        var newName = doc.name.replace(/\.[a-zA-Z]{2,3}$/, ".pdf");
        var newNameWithHyphens = newName.replace(/\s/g, "-");
        var saveName = new File(doc.path + "/" + newNameWithHyphens);
        var saveOpts = new PDFSaveOptions();
        saveOpts.pDFPreset = "[PDF/X-4:2008]";
        saveOpts.standard = "[PDF/X-4:2010]";
        saveOpts.compartibility = "[Acrobat 7 (PDF 1.6)]";
        doc.saveAs(saveName, saveOpts);
    }
}

 

Features of manually made pdf

Ekran Resmi 2023-10-06 10.50.07.pngEkran Resmi 2023-10-06 10.50.15.pngEkran Resmi 2023-10-06 10.50.27.pngEkran Resmi 2023-10-06 10.50.52.pngEkran Resmi 2023-10-06 10.50.59.png

TOPICS
Scripting

Views

132

Translate

Translate

Report

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
Adobe
Community Expert ,
Oct 06, 2023 Oct 06, 2023

Copy link to clipboard

Copied

try commenting out these two lines

 

        // saveOpts.standard = "[PDF/X-4:2010]";
        // saveOpts.compartibility = "[Acrobat 7 (PDF 1.6)]";

Votes

Translate

Translate

Report

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
Advisor ,
Oct 06, 2023 Oct 06, 2023

Copy link to clipboard

Copied

LATEST

Hello @Goldberg_1453,

 

Take a look here at the correct property listinngs...https://www.indesignjs.de/extendscriptAPI/illustrator-latest/#PDFSaveOptions.html#d1e42610__iProps

 

you can give this a try.

var doc = app.activeDocument;
function pdfExport() {
    if (app.documents.length > 0) {
        var newName = doc.name.replace(/\.[a-zA-Z]{2,3}$/, ".pdf");
        var newNameWithHyphens = newName.replace(/\s/g, "-");
        var saveName = new File(doc.path + "/" + newNameWithHyphens);
        var saveOpts = new PDFSaveOptions();
        saveOpts.pDFPreset = "[PDF/X-4:2008]";
        saveOpts.pDFXStandard = PDFXStandard.PDFX42007;
        saveOpts.compartibility = PDFCompatibility.ACROBAT7;
        doc.saveAs(saveName, saveOpts);
    }
}

or just create/save a custom pdf preset with the options you need..

var doc = app.activeDocument;
function pdfExport() {
    if (app.documents.length > 0) {
        var newName = doc.name.replace(/\.[a-zA-Z]{2,3}$/, ".pdf");
        var newNameWithHyphens = newName.replace(/\s/g, "-");
        var saveName = new File(doc.path + "/" + newNameWithHyphens);
        var saveOpts = new PDFSaveOptions();
        saveOpts.pDFPreset = "your custom pdf preset name";
        doc.saveAs(saveName, saveOpts);
    }
}

Regards,

Mike

Votes

Translate

Translate

Report

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