When run in Acrobat, this script searches a PDF for a string. Each time the string is found, the script creates a bookmark for the page that the string was found on.
First you'll need to create the action to run your script:
- Create a New Action in Adobe Acrobat.
- Add an "Execute Javascript" tool to the action.
- Click "Specify Settings" on the tool you added to open the editor.
- Paste the script into the editor and click "OK".
- Ensure that "Prompt User" is checked, and click "Save".
When you run the script, there are two pieces you will need to change:
- For
var stringToSearchFor = "ENTER SEARCH TERM HERE";
(line 3) changeENTER SEARCH TERM HERE
to the string that you'd like to search for. - for
bookmarkPrefix = "ENTER PREFIX NAME HERE";
(line 4) changeENTER PREFIX NAME HERE
to the text you'd like to have appear at the beginning of every bookmark name.