Changing images or image colours in a PDF with Javascript

Community Beginner ,
Jan 30, 2019 Jan 30, 2019

Copy link to clipboard

Copied

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?

TOPICS
Acrobat SDK and JavaScript, Windows

Views

253

Likes

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

Adobe Community Professional , Feb 01, 2019 Feb 01, 2019
This is not possible with JavaScript.

Likes

Translate

Translate
Adobe Community Professional ,
Jan 30, 2019 Jan 30, 2019

Copy link to clipboard

Copied

Adding gif images will not remove the confidential information. Use the Redaction Tool in Acrobat Pro.

Likes

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 Professional ,
Jan 30, 2019 Jan 30, 2019

Copy link to clipboard

Copied

No, no, no! If you want to remove information from a PDF the only reliable way is by using the Redaction tool, and making sure to apply the redactions. Any other way can be overcome... Just ask Paul Manafort's lawyers.

Edit: apply the redactions, not reply...

Likes

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
LEGEND ,
Jan 30, 2019 Jan 30, 2019

Copy link to clipboard

Copied

If you think the GIF can be effective

1. What stops someone else removing it

2. Try this: go to text selecting, select all, copy. All text behind your covers will copy too.

Likes

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 Beginner ,
Feb 01, 2019 Feb 01, 2019

Copy link to clipboard

Copied

Ok. Thanks everyone for the answers.

I wish we use Adobe more properly. But that's not the case. We scan documents as images, no ocr. And after that we hide information with the blocks. Then we print it. So there is no chance of anyone removing the blocks.

I know there has to be another way to do that. I'll look into that later.

But i need to know if is possible to change the colour of the blocks with javascript.

Likes

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 Professional ,
Feb 01, 2019 Feb 01, 2019

Copy link to clipboard

Copied

This is not possible with JavaScript.

Likes

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 Beginner ,
Feb 01, 2019 Feb 01, 2019

Copy link to clipboard

Copied

LATEST

I have just checked the Redaction tool and it seems pretty easy. But i wish i could change the color images anyway.

Likes

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