I got an interesting request from Rick Borstein who is one of our Acrobat Product Specialists. It seems that one of his customers is using the new Compare Documents feature in Acrobat 9 for long legal documents. This is actually a perfect use case for this feature but the customer is hampered by the fact that Compare Documents can sometimes find too much. As a text heavy legal document, they don’t have much need for the per pixel differences in graphics and certainly don’t need to see “Matching graphic not found” beside every change bar.
The customer was either looking for a way to “tune” what Acrobat was looking for, which will need to wait for the next release, or simply have an easy way to remove the change indicators that they don’t need. The one tricky part was that they wanted a user interface (UI) to delete all of the change indicators that matched a different set of criteria. I’m not much of a UI designer and even with Windjack’s Acrodialogs plug-in, creating a UI in Acrobat JavaScript would have turned this fun experiment into…. well…. work!
Background:
When Acrobat 9 compares documents, the change indicators that it creates are actually annotations. The Acrobat JavaScript API has been able to manipulate annotations since version 5.0 and that part of the API has evolved quite a bit since then. Because you can ask Acrobat JavaScript to collect the annotations into an array and filter them based on a variety of criteria, it doesn’t require a lot of code to grab all of the annotations in a document and process them; “for” loops can be a lazy programmers best friend.
The Script:
By installing the JavaScript in a folder at the application level, I was able to add a menu item that makes this simple script behave like an Acrobat feature available to any document.
To solve the UI problem, I decided write the script so that it could detect which annotation was selected, determine it’s properties and then look for more just like it. That way the user just needs to select an annotation, choose my menu item "Delete Annotations of the Same Type and with the Same Content as the one Selected" and all that’s it. No UI required.
The links in the bullet list will take you to the appropriate section of the Acrobat JavaScript Reference.
The example demonstrates
- Adding SubMenus and Menu Items
- Detecting which annotation is selected
- Detecting annotation properties
- Deleting annotations
- Use of the thermometer object
This JavaScript will add a menu item “Joel’s Comment Utilities” under “Comments” menu.
Under that menu, you will find three additional menu items.
- Delete “Matching graphic not found” Annotations
This menu item will delete all “Highligh” annotations with content “Matching graphic not found” - Delete Annotations of the Same Type and with the Same Content as the one Selected
To use this menu item, select one of the type of comment that occurs frequently that you want to remove all of then select the menu item.
All comments of the same type and same content will be deleted. - Count Annotations of the Same Type and with the Same Content as the one Selected
Same as above except that comments are not deleted, they are simply counted.
Installing Joel’s Comment Utilities
1. Quit Acrobat if it is already running
2. Download “Joel’s Comment Utilities” and then copy the ADBE_JFG_RemoveMatchingAnnots.js file into the following file location:
a. WIN XP
C:\Documents and Settings\Administrator\Application Data\Adobe\Acrobat \9.0\JavaScriptsb. WIN VISTA
C:\Users\USERNAME\AppData\Roaming\Adobe\Acrobat\9.0\JavaScriptsc. MAC OSX
/Users/YOURUSER/Library/Application Support/Adobe/Acrobat/9.0_x86/ JavaScripts
3. Restart Acrobat
Using the Reduce Comments Script
1. Open a PDF containing comparison comments
2. Choose one of the following commands:
a. Comments | “Joel’s Comment Utilities” | Delete Matching Graphic Not Found Comments
– or -
b. With another type of comment selected, choose:
Comments | Joel’s Comment Utilities | Delete Annotations with same content as one selected


Well Written article on Document Comparison. Thanks for your valuable info.
Are Joel’s Comment Utilities still available. I get a 404 error trying to navigate to them.
I wasn’t able to get to the download
http://www.joelgeraci.com/adobe/devjunkie/web/downloads/ADBE_JFG_RemoveMatchingAnnots.js
Is there an alternate link that I can use to download your comments utilities?
Thanks,
Chris.
There have been some problems with the content management system. We’ll try to track it down.
The download link still doesn’t work. Is there any alternate link available?
OMG too much technical jargon. I do not have the redaction toolbar in my Adobe (9.4.6). Can you simply tell me how to get it? I will be forever grateful…
Now, if you do that and I find my way back to see what you say, that will be a miracle …
Hi Kim – do you have Acrobat 9 Professional? The standard version does not have the redaction tools.
Can you help me with this but in a less techy manner. I am not familiar enough with the scripts and how to load one but I am so frustrated with this same issue that the customer describes. I have to compare two files..one pdf comes from the printer and I’m not sure what the original format was before it was a PDF. The printer says they have a proprietary software so its not Word/Indesign/Quark I guess. When I compare their PDF with the PDF of the file I have, EVERYTHING is redlined, even if the number / text matches theirs, it shows that it as removed and replaced with the same. It is frustrating, especially during our busy season.
Without access to the specific PDF files you mention, it’s impossible to diagnose this sort of behavior.