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.
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?
