Copy link to clipboard
Copied
Hi, I am requesting support to censor words identified in a PDF using JavaScript from the console that incorporates the Acrobat Reader console. Which method can be called so that once that word is identified, the method is executed and censors the words?
I hope this helps!
Copy link to clipboard
Copied
This is not possible with the free Reader. You would need Acrobat to do it safely using Redactions.
Copy link to clipboard
Copied
This requires Acrobat Pro.
Acrobat Reader and Acrobat Standard cannot redact documents.
Copy link to clipboard
Copied
We have the Pro version at work, but we want to censor using JavaScript in the console, but I haven't found the method in the API. At the moment we have a script that marks the words to be censored, but we can't find any direct method to censor from the script.
Thanks soo much
Copy link to clipboard
Copied
this.applyRedactions();
Copy link to clipboard
Copied
Thank you very much, I will try that method.
Where is this in the documentation?
Copy link to clipboard
Copied
Under the Methods section of the Document object in the Acrobat JS API Reference.
Copy link to clipboard
Copied
How are you identifying the words?
Copy link to clipboard
Copied
add_annot()
[...]
var qd1 = getPageNthWordQuads(page, position);
qd1 = String(qd1).split(',');
rg2 = new RegExp(words[words.length - 1]); // for saving the posible words[-1]
wd2 = this.getPageNthWord(page, position + words.length - 1, false);
if (rg2.test(wd2)) { // checks if rg2 trully is words[-1]
var qd2 = getPageNthWordQuads(page, position + words.length - 1);
qd2 = String(qd2).split(',');
if (qd1[1] == qd2[1]) { //checks if words[0] is in the same line as words[-1]
// qd = [[left, top, right, top, left, bot, right, bot]];
var qd = [[qd1[0], qd1[1], qd2[2], qd1[3], qd1[4], qd1[5], qd2[6], qd1[7]]];
add_annot(page, qd);
} else {
for (var w = 0; w < words.length; w++) {
var qd = getPageNthWordQuads(page, position + w);
add_annot(page, qd);
}
}
}
[...]
Find more inspiration, events, and resources on the new Adobe Community
Explore Now