top of page

Acrobat Java Script to Find Pages Marked for Redaction


'try67; has posted a javascript here, which you can use to count the number of pages in a PDF file which are marked for redaction. As the discussion on Adobe forum shows some people have not had much luck getting the script to work. The problem can be overcome by inserting the javascript into an Adobe action. Follow these steps:

1. In the Tools console, go to Action Wizard and select 'Create New Action'.

2. Choose More Tools . . . Execute Javascript and click it into the 'Action steps to follow' area on the right. Uncheck the 'Prompt User' box, and click in 'Specify Settings'.

3. Enter this script in the Javascript Editor:

this.syncAnnotScan(); var counter = 0; for (var p=0; p<this.numPages; p++) { var annots = this.getAnnots({nPage: p}); if (annots==null || annots.length==0) continue; for (var i in annots) { if (annots[i].type=="Redact") { counter++; break; } } } app.alert(counter + " pages contain Redaction annotations in this file.",3);

4. Name and save the action.

5. When you click on the new action in the Action Wizard menu, you will be prompted to select multiple PDF files.

6. Click start and Acrobat will start to open the files and indicate the number of pages marked for redactions in each PDF.

It would be helpful if the javascript was modified to generate a textual list for each file rather than showing the counts in successive dialog boxes.


bottom of page