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

• Saving PDF with "embedded ICC profiles", doesn't work...

Engaged ,
Jun 19, 2019 Jun 19, 2019

Copy link to clipboard

Copied

Hello -

I try to write up a script that will generate a PDF on the fly.

The PDF must embed the "ICC profile" and must have all images embedded.

The PDF is generated, but neither the "ICC profile" nor "images" are embed 

Any idea why?

Here is a snippet of my code:

#target Illustrator

#targetengine main

app.activeDocument.selection = null; // Ensure there is nothing in the document selected already. This way you only get the selection you want. 

app.redraw(); 

app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;

var myDoc = app.activeDocument;

var myLayers = myDoc.layers;

var PDF_HRpreset = "[Press Quality]";

var HighResOpts  = new PDFSaveOptions(); // Create the PDFSaveOptions object to set the PDF options/properties

HighResOpts.embedICCProfile = true;

HighResOpts.pDFPreset = PDF_HRpreset;

//

// Embed ALL images (So we don't loose images' links when we open the PDF with Illustrator   <-  Client's late request)

//

if ( myDoc.length > 0 ) {

while ( app.activeDocument.placedItems.length > 0 ) {

        placedArt = app.activeDocument.placedItems[0];

        placedArt.embed();

    }

}

myDoc.saveAs(File("~/Desktop" + "/" + myDoc.name.replace(".ai", "_MOCKUP.pdf")), lowResOpts);

Thank you for any help. Regards,

- Dimitri

Message was edited by: Vasily Hall

TOPICS
Scripting

Views

843

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

correct answers 1 Correct answer

Community Expert , Jun 19, 2019 Jun 19, 2019

you probably need

HighResOpts.colorProfileID = ColorProfile.INCLUDEALLPROFILE;

about embedding...your problem is line 25

Votes

Translate

Translate
Adobe
Community Expert ,
Jun 19, 2019 Jun 19, 2019

Copy link to clipboard

Copied

you probably need

HighResOpts.colorProfileID = ColorProfile.INCLUDEALLPROFILE;

about embedding...your problem is line 25

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
Engaged ,
Jun 19, 2019 Jun 19, 2019

Copy link to clipboard

Copied

Good morning Carlos -

Thank you for your quick reply.

I'll definitively give it a try and give some feedback.

Regards,

- Dimitri

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
Engaged ,
Jun 21, 2019 Jun 21, 2019

Copy link to clipboard

Copied

Hello Carlos -

Thx, it works like a charm 

Solution to embed the profiles is thus:

HighResOpts.colorProfileID = ColorProfile.INCLUDEALLPROFILE;

Regarding the embed all images problem, I finally decided to work with this piece of code:

//

// Embed ALL images (So we don't loose images' links when we open the PDF with Illustrator   <-  Client's late request)

//

function embedInAllDocuments_fct() {

    var placedArt;

    for (var i=app.documents.length-1; i>-1; i--) {

        while ( app.documents.placedItems.length > 0 ) {

            placedArt = app.documents.placedItems[0];

            placedArt.embed();

        }

    }

}

So, thank you again Carlos for your time and knowledge  🙂

Regards,

- Dimtiri

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
Community Expert ,
Jun 21, 2019 Jun 21, 2019

Copy link to clipboard

Copied

you're welcome,

but did you see what the issue was with line 25 in your first script?

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
Engaged ,
Jun 21, 2019 Jun 21, 2019

Copy link to clipboard

Copied

LATEST

Nope… 😞

Except if "MyDoc" was undefined or something like this.

I'm sorry.

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