Creating bookmarks based upon text search or comments
Copy link to clipboard
Copied
I have several 1,500 page documents. Suffice it to say that they are each composed of various customer information, "split up" by file number, but merged into one document. So, for example, I have 732 different client files in one 1,500 page document. The common demoninator is that each file begins with a File Number field, always denoted as "File Number: #########" followed by a hard return. So I have this -
File Number: #################
random customer information
I want to create a bookmark for each occurence of "File Number:" - it was easy enough for me to highlight every occurrence with a comment, but I am absolutely stumped on how to create bookmarks for this which would greatly help me. I would be perfectly happy if I could create a bookmark based upon a word search (e.g. File Number:), or based on existing comments. But I can't find anything that doesnt cost money (like the auto-bookmark plug-in) that can accomplish this. Any ideas? Bonus points if I can get it to actually be named with the corresponding ######, as opposed to just File Number: - pretty much all I can do at this moment is just use the search function with the bookmarks function, and press bookmark all 732 times; not only is this tedious, but it also won't identify the trailing numbers.
Copy link to clipboard
Copied
This requires a complex script, which would usually cost money, or you would need to learn how to develop it yourself.
Don't expect someone to just give you the full code, but we could provide pointers and guide you to places where you could learn how to do it.
Copy link to clipboard
Copied
How did you find and highlight the file numbers automatically? If the file number text is in the comment for the highlight annotation, then this info could be used to create bookmarks for the PDF.
You'll find Action scripts here that might be of help. There is one for searching and highlighting words
https://www.acrobatusers.com/actions-exchange/
In JavaScript Bookmarks are created with the doc.bookmarkRoot.createChild() function.
Here's the reference entry:
Use the Acrobat JavaScript Reference early and often

