I have a collection of documents where I'd like to extract a page range to a new PDF. The page range is dynamic and is based on text on the page.
I'm a PostScript guy and have done a lot with PDF internals, but not with Acrobat itself.
Looking through the documentation, I see:
as a method. It works, returning a list of the pages containing my target text. So far so good.
I also see
which works as well.
What I'd like is direction as to how to put all of them together, so that I can
1) search for pages containing a text string
2) enumerate through those pages, retrieving and calculating page numbers (this.pageNum?)
3) use those page numbers to extract page ranges.
For example, assume that a section starts with the word "New Section". A search would reveal that I have "New Section" pages on pages 5, 10, and 12. I would like pages 5-9 extracted to a named PDF, pages 10 & 11 to a second PDF, and pages 12 through last page into a 3rd PDF.
I don't need someone to write the program for me, just point me to the appropriate methods, etc.
Currently I can't figure out how to use the search.query results to navigate/retrieve those specific pages.
Thomas D. Greer
I'm a PostScript guy and have done a lot with PDF internals, but not with Acrobat itself.
Looking through the documentation, I see:
Code:
search.query
as a method. It works, returning a list of the pages containing my target text. So far so good.
I also see
Code:
doc.extractPages
which works as well.
What I'd like is direction as to how to put all of them together, so that I can
1) search for pages containing a text string
2) enumerate through those pages, retrieving and calculating page numbers (this.pageNum?)
3) use those page numbers to extract page ranges.
For example, assume that a section starts with the word "New Section". A search would reveal that I have "New Section" pages on pages 5, 10, and 12. I would like pages 5-9 extracted to a named PDF, pages 10 & 11 to a second PDF, and pages 12 through last page into a 3rd PDF.
I don't need someone to write the program for me, just point me to the appropriate methods, etc.
Currently I can't figure out how to use the search.query results to navigate/retrieve those specific pages.
Thomas D. Greer