Changing images or image colours in a PDF with Javascript
Hi.
I have a big document with confidential information. We have to send it to a person, but we must to hide some information in it.
My collegue has been working in the document for several days adding white blocks wherever a critic information is. She added a white gif image and rearranged the size for every situation.
Now we have realized that the block should be black.
I tried to run a Javascript to change the colour of the blocks but i't doesn't work.
This is the code:
// Get a color convert action
var toBlack= this.getColorConvertAction();
// Set up the action for a conversion to Black
toBlack.matchAttributesAll = toBlack.constants.objectFlags.ObjImage
toBlack.convertProfile = "Apple RGB";
toBlack.convertIntent = toBlack.constants.renderingIntents.Document;
toBlack.embed = true;
toBlack.preserveBlack = true;
toBlack.colorantName = "Black";
toBlack.isProcessColor = true;
toBlack.useBlackPointCompensation = true;
toBlack.action = toBlack.constants.actions.Convert;
// Convert the first page of the document
var result = this.colorConvertPage(0,[toBlack],[]);
Any clue why it's not working or an alternative?
