I am new to Acrobat, but not to basic scripting in other tools and programming languages.
I have a requirement to be able to load multiple PDFs into a folder, define search terms in order, and output results as follows:
- perform a proximity search on the terms, but only in the order they appear in the search box. For example if I am searching for terms A and B, if B occurs within 5 words following A, it is returned as a hit. If A occurs within 5 words following B it is not returned.
- the terms must be in the same sentence to be returned
- the output should bring the entire sentence where the words are found.
- Bonus: if multiple word terms are allowable to searched as a single value - like "A B" C, where if "C" follows the combined words "A B" within 5 words, yada yada.
Is this possible by creating custom actions in Acrobat? The first bullet is the most critical to avoid a lot of false hits
It should be, but it's quite an advanced scripting task. Plus there is the extra difficulty of defining what's a sentence in a PDF file... It might seem trivial, but it's far from it. In fact, many times it's not possible at all to do it, depending on how the file is structured. You also need to take into account cases where the text you're searching for appears on different pages. While unlikely, it's not impossible and would complicate matters even more.
I've developed my own (paid-for) tool that I called "Advanced Proximity Search" and which offers additional features on top of the built-in ones that Acrobat has. While it does not include the ones you mentioned I could probably adjust it so that it does. The tool can be found here: https://www.try67.com/tool/acrobat-reader-advanced-proximity-search
If you're interested in hiring someone to do this for you, feel free to contact me privately via [try6767 at gmail.com] to discuss it further.