Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Using Actions to call Acrobat regular expressions

New Here ,
Apr 25, 2017 Apr 25, 2017

I'm working with Acrobat X.

In Tools > Protection > Search and Remove Text, you have the option to search for regular expression patterns found here:

C:\Users\[user name]\AppData\Roaming\Adobe\Acrobat\10.0\Preferences\Redaction\ENU\SearchRedactPatterns.xml

I want to create an Action that calls that list of Acrobat regular expressions.

In the Action Wizard, when creating a new Action (Protection > Search & Remove Text), you don't get the option to look for those patterns. Has anyone done this?  Dose anyone know a simple way to modify the generated .sequ file so it will do this?

<</Commands [/c << /0 [/c << /Config [/c << /UIPolicy [/i 3]

>>]

  /HandlerName [/a /SearchAndRedactCmd]

  /Params [/c << /CaseSensitive [/b false]

  /WholeWord [/b false]

  /WordList [/n null]

>>]

  /Title [/t (Search & Remove Text)]

>>]

>>]

/Description [/t (calls standard Acrobat regex patterns)]

/Input [/c << /FileVariation [/i 3]

>>]

/Output [/c << /AddToBaseName [/b false]

  /DontOverwrite [/b false]

  /EmbedIndex [/b false]

  /FileVariation [/i 1]

  /HandleOutput [/b true]

  /NumbericNaming [/b false]

  /OptimizePDF [/b true]

  /PresetName [/t (Standard)]

  /RunPDFOptimizer [/b false]

>>]

>>

TOPICS
Acrobat SDK and JavaScript
4.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Apr 26, 2017 Apr 26, 2017

Acrobat uses EMCA JavaScript which includes the Regular Expression object. To use this object one needs to write some custom JavaScript cod. There is no "Regular Expression" option in the GUi for Acrobat's Action or batch processing. One needs to select the "JavaScript" action and then the necessary code to call a user written string function to find the word(s) using the specified Regular Expression include all of the custom code within the JavaScript code being added to the Batch Action. Form

...
Translate
LEGEND ,
Apr 26, 2017 Apr 26, 2017

Acrobat uses EMCA JavaScript which includes the Regular Expression object. To use this object one needs to write some custom JavaScript cod. There is no "Regular Expression" option in the GUi for Acrobat's Action or batch processing. One needs to select the "JavaScript" action and then the necessary code to call a user written string function to find the word(s) using the specified Regular Expression include all of the custom code within the JavaScript code being added to the Batch Action. Form what you have posted it looks like you only have the necessary housekeeping actions to select and save processed files.

See Text matching with regular expressions using JavaScript by Thom Parker.

I would develop the code for processing an open PDF and then move that code into the Action.

See Acro Law's Creating and Using Custom Redaction Patterns.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 25, 2017 Jul 25, 2017
LATEST

Thank you for answering the question. It took me a while to figure that out but you're right. Got the code to work with some insight from Thom Parker and Ricardo Falegnami. I'll try to get something published to the Actions Exchange in the near future

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines