Skip to main content
rolfs75271766
Participant
July 2, 2024
Question

JavaScript for Acrobat API - Color conversion, Matching criteria, set Object Type to 'Image'

  • July 2, 2024
  • 1 reply
  • 337 views
Hello community,

I want to embed a colour profile in a PDF file using Javascript.
This works well with the following script:

 

var toColorProfile = this.getColorConvertAction();
toColorProfile.matchAttributesAny = -1;
toColorProfile.matchAttributesAll = -1;
toColorProfile.matchSpaceTypeAny = -1
toColorProfile.matchIntent = toColorProfile.constants.renderingIntents.Any;
toColorProfile.convertProfile = 'PSO Coated v3';
toColorProfile.convertIntent = toColorProfile.constants.renderingIntents.Any;
toColorProfile.embed = true;
toColorProfile.action = toColorProfile.constants.actions.Convert;
toColorProfile.colorConvertAction = toColorProfile.constants.actions.Convert;
this.colorConvertPage(0, [toColorProfile], []);

 

 

But what i want to achieve is, that only the images are converted to the given colour profile and all other elements in the PDF are retained. In other words: i want to embed the colour profile with the settings shown in the screenshot, but with JavaScript.
So my question is: how do I have to adapt my script, that the colour profile only changes the images in the PDF and leaves all other elements as they are?
    This topic has been closed for replies.

    1 reply

    kglad
    Community Expert
    Community Expert
    July 2, 2024

    in the future, to find the best place to post your message, use the list here, https://community.adobe.com/

    p.s. i don't think the adobe website, and forums in particular, are easy to navigate, so don't spend a lot of time searching that forum list. do your best and we'll move the post (like this one has already been moved) if it helps you get responses.



    <"moved from using the community">