Redact to Highlight and Back


One of the ways that Adobe Acrobat 9 and X can help you control your work is to make it easier to remove sensitive information before distributing it outside your organization. For those of you not in the legal profession, this is called redaction. Redaction is designed to permanently remove from the document all content that is being redacted and to put an indicator that this happened in it’s place.

The way that redaction works in Acrobat 9 is that you first create redaction marks which doesn’t remove any content and then after you have worked your way through the document completely, you apply those redactions and the information is remove and replaced with, usually black, boxes and optionally codes that indicate the reason the information was removed.

More Fun with the JavaScript API:

If you’ve spent any time in Acrobat SDK land, it shouldn’t come as a surprise that the redaction markup is
just special type of annotation. To demonstrate how easy it is to extend the redaction functionality through JavaScript, I wrote “Joel’s Redaction Utilities”; a simple JavaScript that can be used to toggle redaction markup and highlight annotations. The bulk of the script is actually stolen from my earlier post which iterated through every annotation in the PDF file and…. well…. rather than repeat myself, you can read all about it here.

The beauty of working with the different annotation types in Acrobat JavaScript is that the annotation objects share many of the same common properties. Redaction markup is an annotation of the type “Redact” and highlights are annotations of the type…. you guessed it…. “Highlight”. The one thing you need to know about toggling annotation types is that you actually can’t. The “type” property of an annotation object is read-only. What you need to do (and what’s demonstrated in the example JavaScript) is to collect from the original annotation all of the properties that you are necessary to create a new one of a different type in it’s place. Then you add the new annotation and destroy the original. In the case of this example I get the “quads“, an array of coordinates representing the corner points of a rectangle, and the page number of the original annotation then use those settings as properties for the new one. The new annotation shows up at the exact same coordinates as the original but behaves differently because it’s of a different type. It’s kind of like those transporter accident episodes of Star Trek TOS; all of the properties of the original are basically the same but now Spock has a goatee.

This example demonstrates:

This JavaScript code will add a menu item “Joel’s Redaction Utilities” at the bottom of the “Edit” menu.

Under that menu, you will find two additional menu items.

  • Convert Redaction Marks to HighlightsThis menu item will convert all Redaction Marks to Highlights. The Highlight color will be the same color as your default (usually Yellow).
  • Convert Highlights to Redaction MarksThis menu item will convert all Highlights to Redaction Marks – The Redactions will not be applied by this script though it can be easily modified to do so.

Installing Joel’s Redaction Utilities

1. Quit Acrobat if it is already running

2. Download “Joel’s Redaction Utilities” and then copy the ADBE_JFG_RemoveMatchingAnnots.js file into the following file location:


C:\Documents and Settings\Administrator\Application Data\Adobe\Acrobat \9.0\JavaScripts

b. WIN 7 and VISTA



/Users/YOURUSER/Library/Application Support/Adobe/Acrobat/9.0_x86/ JavaScripts

3. Restart Acrobat