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

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

794

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

This is not possible with JavaScript.

Votes

Translate

Translate
Community Expert ,
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.

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

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

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

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

Copy link to clipboard

Copied

This is not possible with JavaScript.

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

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