More Fun with JavaScript and the "Redact" Annotation

| 2 Comments

A few months back I posted an article introducing
Joel’s Redaction Utilities
.
For those of you still unfamiliar with what redaction is I’ll quote from that article…

 

One of the ways that Adobe Acrobat 9 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.

 

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.

 

Well – Rick Borstein, the guy behind the Acrobat for Legal Professionals blog asked me to create another example to show how you can use Acrobat JavaScript to streamline repetitive tasks like applying redaction codes to a set of reaction annotations. Typically, you’d need to open up each redaction annotation’s properties dialog to change or set the redaction code one at a time. With just a few lines of JavaScript, you can dramatically reduce the number of steps.

Introducing “Joel’s Redaction Palette”
After installing the JavaScript for my redaction palette, you’ll see a set of buttons added to the Acrobat UI. If you don’t see them, right-click (win) or control-click (mac) in the toolbar and select “Add-on Tools”. Each button corresponds to a redaction code that you might want to use frequently. I have three already set up in the example.

 

This example demonstrates:

 

 

Use:
Select one or more redaction annotations. Click the toolbar button that corresponds to the redaction code or overlay text that you want to apply. That’s it. The JavaScript replaces the overlayText property of any selected annotations of the type “Redact”. To customize the example to fit your specific needs, just download the file (see below) and modify the codeArray in line 14. To add additional codes, put the codes in quotes and separate them by commas. You can add as many as are practical and optionally delete the ones that are there.

 

codeArray = [“(b) (1) (A)”, “(b) (1) (B)”, “(b) (2)”]

 

Installing Joel’s Redaction Palette
1. Quit Acrobat if it is already running
2. Download “Joel’s Redaction Palette” and then copy the ADBE_JFG_SetRedactOverlayText.js file into the following file location:

 

a. WIN XP
C:\Documents and Settings\USERNAME\Application Data\Adobe\Acrobat \9.0\JavaScripts

 

b. WIN VISTA
C:\Users\USERNAME\AppData\Roaming\Adobe\Acrobat\9.0\JavaScripts

 

c. MAC OSX
/Users/YOURUSER/Library/Application Support/Adobe/Acrobat/9.0_x86/JavaScripts

 

3. Restart Acrobat