top of page

Javascript to redact highlighted text in Adobe Acrobat

If you have a set of PDFs which attorneys have highlighted to show which excerpts in the documents they want to be redacted, you can run a Javascript in Adobe Acrobat to convert the highlighted text to redactions.


Follow these steps:


  1. In Acrobat, under Tools, open the 'Action Wizard'.


ree
  1. Select 'New Action'


    ree

. . . and then add the 'Execute JavaScript' tool. Be sure to uncheck 'Prompt User'


ree

  1. Click on 'Specify Settings' and then add the below script into the Editor:



this.syncAnnotScan();

var annots = this.getAnnots();

if (annots != null) {

    for (var i in annots) {

        var annot = annots[i];

        if (annot.type == "Highlight") {

                                    annot.type = "Redact";

                                    annot.fillColor = color.black

                        }

    }

}

this.applyRedactions();



ree

  1. Next, add a command in the action to save the file.

ree
  1. Under the Save settings, enter a suffix for the new file that will be saved:

    ree

  2. Name and save the new action:


ree

  1. When you run the action


ree

. . . it will prompt you to select multiple files



ree




This script will redact highlighting of different colors - not just yellow, but pink, blue, green, or whatever color has been used.



ree


ree

Note that if other text in the PDF has been marked for redaction:


ree


. . . this script will apply those redactions.



ree

Sean O'Shea has more than 20 years of experience in the litigation support field with major law firms in New York and San Francisco.   He is an ACEDS Certified eDiscovery Specialist and a Relativity Certified Administrator.

The views expressed in this blog are those of the owner and do not reflect the views or opinions of the owner’s employer.

If you have a question or comment about this blog, please make a submission using the form to the right. 

Your details were sent successfully!

© 2015 by Sean O'Shea . Proudly created with Wix.com

bottom of page