Giter VIP home page Giter VIP logo

acrobat-redax's Introduction

Acrobat-redax

Regular expressions that expand Adobe Acrobat's search-and-redact functions.

What is this for?

Adobe Acrobat's redact tool can search for patterns; however, the functionality is limited. For example, the built-in English (US) patterns are:

  • Social Security numbers
  • email addresses
  • phone numbers
  • dates
  • credit card numbers

Anyone unfortunate enough to have a light understanding of regex can add patterns. I have such an understanding. Read on and you might too.

How do I add search redact patterns?

๐Ÿ“‚ Open the search redact patterns file (after backing it up)
๐Ÿ“ Create or edit a set
๐Ÿ’พ Save the edited file
๐Ÿ” Restart Acrobat and redact away

Rick Borstein wrote about creating and using custom redaction patterns on the now-defunct blog Acrolaw. A good chunk of this walk-through is duplicative of Rick's great primer, which seems to have been carried over to Adobe's general blog.

๐Ÿ“‚ Open the search redact patterns file (after backing it up)

Redaction patterns are stored in XML files. These files begin with the prolog <?xml ... ?> and end with tag </asf>.

Before opening or editing the search redact patterns file, it's good to make a backup copy. You might save the original, unedited version as SearchRedactPatterns-backup.xml. screenshot of the beginning of SearchRedactPatterns.xml macOS: /Users/<username>/Library/Preferences/Acrobat/<version>/Redaction/<locale>/SearchRedactPatterns.xml

Windows Vista and newer: \Users\<username>\AppData\Roaming\Adobe\Acrobat\<version>\Preferences\Redaction\<locale>\SearchRedactPatterns.xml. The AppData folder is hidden by default. To navigate to it, type %AppData% into the Windows Explorer.

Windows XP: \Documents and Settings\<username>\Application Data\Adobe\Acrobat\<version>\Preferences\Redaction\<locale>\SearchRedactPatterns.xml.

Note that there is a SearchRedactPatterns.xml one level up in ...\<version>\Redaction\, and changing that file won't make your patterns appear.

Locales
For each version of Acrobat on the machine, there is a pattern file for each locale that has been used. For example, if my computer has both Acrobat DC and Acrobat XI, /Adobe/Acrobat will contain both /DC and /11. If I have used Acrobat XI to search in Japanese and United States locales, then /11 will contain /Redaction/JPN/SearchRedactPatterns.xml and /Redaction/ENU/SearchRedactPatterns.xml.

To change locale, or to force Acrobat to create the SearchRedactPatterns.xml file you want to edit, open Acrobat and navigate to Preferences>Documents and select your desired locale from the dropdown menu under the Redaction heading.

You may also select from the redact search window "Choose different locale for patterns".

๐Ÿ“ Create or edit a set

Each pattern is stored as a "set" with the following syntax:

<set name="Entry4">
<str name="displayName">
<val>Email Addresses</val>
</str>
<str name="regEx" translate="no">
<val>([a-zA-Z0-9_])([a-zA-Z0-9_\-\.])*@([a-zA-Z0-9\-])+\.([a-zA-Z\.]+)</val>
</str>
<str name="examples">
<val>This pattern will search for email addresses.

For example:
[email protected]
[email protected]
[email protected]</val>
</str>
</set>

Simply copy a set, such as the one above, and change the entry number, pattern name, pattern, and description, as highlighted below: screenshot example highlighting the entry number, pattern name, pattern, and description

๐Ÿ’พ Save the edited file

Pretty self-explanatory. Don't change the file's name or location. Do have a backup!

๐Ÿ” Restart Acrobat

After saving the file, restart Acrobat. Open a PDF and choose the redact tool. When you search for a pattern, the dropdown menu now includes your new options!


Misc.

  • Save a copy of the original XML file before you begin tinkering.
  • The only attribute value you need to change is the set number (e.g., "Entry5").
  • In Acrobat 9 and up, different patterns exist for different countries and languages ("locales"). See locales above.
  • I thought that Acrobat used a Perl regex engine and that you might be able to switch it to Java. This was based on documentation and forums on other Adobe products, specifically InDesign and ColdFusion. That ColdFusion page has a feature comparison table of the two engines. Another user said it uses JavaScript RegExp. If the differences matter to you, then you're probably beyond my help.

acrobat-redax's People

Contributors

juneau avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.