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

censuring words

New Here ,
Oct 29, 2024 Oct 29, 2024

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!

TOPICS
Acrobat SDK and JavaScript
266
Translate
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 ,
Oct 29, 2024 Oct 29, 2024

This is not possible with the free Reader. You would need Acrobat to do it safely using Redactions.

Translate
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 ,
Oct 29, 2024 Oct 29, 2024

This requires Acrobat Pro.

Acrobat Reader and Acrobat Standard cannot redact documents.


Acrobate du PDF, InDesigner et Photoshopographe
Translate
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
New Here ,
Oct 29, 2024 Oct 29, 2024

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

Translate
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 ,
Oct 29, 2024 Oct 29, 2024

this.applyRedactions();

Translate
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
New Here ,
Oct 29, 2024 Oct 29, 2024

Thank you very much, I will try that method.
Where is this in the documentation?

Translate
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 ,
Oct 29, 2024 Oct 29, 2024
LATEST

Under the Methods section of the Document object in the Acrobat JS API Reference.

Translate
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 ,
Oct 29, 2024 Oct 29, 2024

How are you identifying the words?

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
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
New Here ,
Oct 29, 2024 Oct 29, 2024

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);
}
}
}
[...]

Translate
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