Skip to main content
Participating Frequently
May 14, 2020
Question

pdf redaction using Acrobat Javascript

  • May 14, 2020
  • 3 replies
  • 3081 views

Hi community,

 

I am trying to redact my pdf using the following method,

 

this.addAnnot({

type: "Redact",

page: myPage,

quads: myQuads

});

 

It can successfully white out the area that I want it to be redacted. But I wonder, is there any properties that can be used to color the area instead of white it out? Or can someone please share the related API document?

 

Thanks:-)

 

This topic has been closed for replies.

3 replies

Thom Parker
Community Expert
Community Expert
May 14, 2020

Yes, you need to use the "doc.applyRedactions()" function;

https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/#t=Acro12_MasterBook%2FJS_API_AcroJS%2FDoc_methods.htm%23TOC_applyRedactionsbc-12&rhtocid=_6_1_8_23_1_11

 

But there are also a number of special properties for the "Redact" annot that povide the appearnce of  the redacted area.

Look it up here:

https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/#t=Acro12_MasterBook%2FJS_API_AcroJS%2FAnnotation_types1.htm

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Adobe Employee
May 14, 2020

Hi,

 

You can try "fillColor:["RGB",x,y,z] to set the color property, also as mentioned by Test_Screen_Name correctly, are you using applyRedactions as well to redact the marks you are creating? 

 

Thanks,

Charu Karwa

 

Legend
May 14, 2020

Warning: That doesn’t remove anything - it isn’t (yet) redaction and can easily be removed, showing you “hidden” text. Unless you also use applyRedactions. Do you use applyRedactions?