These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Acrobat Search in JavaScript

hrjahanian
Registered: Nov 19 2009
Posts: 3

I'm trying to find a way in JavaScript to extract all the pages of a document which contain a specific text. Is it possible to use the result of "search" in JavaScript and find out the page numbers? Because then I can use the "extractPage" method to extract the pages.

My Product Information:
Acrobat Pro 8.1, Windows
itsmikem
Registered: Jul 14 2009
Posts: 44
I've never done anything with the search but in the docs, I see that the results show up in the find box. So, what if you see the results there, then get the value of Doc.pageNum, the current page, and add it to an array. Just a thought.

- Mike
hrjahanian
Registered: Nov 19 2009
Posts: 3
Michael Mendelsohn wrote:
I've never done anything with the search but in the docs, I see that the results show up in the find box. So, what if you see the results there, then get the value of Doc.pageNum, the current page, and add it to an array. Just a thought.- Mike
-Thanks Mike. I thought once about looking, visually, at the result table and writing down the page numbers and making a list of all pages and then extracting those pages by a script. Is that what you mean?
My problem is that the main document is relatively huge and the word I'm looking for is appeared lots of time, and therefore I will have to make a long list of page numbers, which will be subject to probable eye mistakes.
That's why I was looking for a way to get the page numbers automatically through a script. There should be a way to extract the result of Acrobat Search into a text file or something! I think that should be very basic with JavaScripting in Acrobat.
CLB
Registered: Dec 1 2009
Posts: 1
I agree, I just spent the greater part of this entire evening trying to figure out how to export the results of a search into a new file. I have a project involving thousands of scanned invoices which were filed unfortunately in almost no order and I need them sorted into seperate files by vendor. Cannot resort the originals before scanning as client likes its filing methodology so have to scan in original order - figured out how to make the sticky note so that search results are exactly what I want - now I can't do anything with it - I will have to manually open each PDF and drag the results into a new file for each vendor - this seems like it would be a very basic feature for Acrobat to have - lots of uses - Adobe programmers - we need this feature. You should be able to print just the pages listed in search results and also to extract them to a new PDF file. This needs to be an easy to find and figure out button too :) please hurry and write it!!!