Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Javascript for searching in specific pages

New Here ,
Jul 08, 2017 Jul 08, 2017

I'm searching for a javascript that is searching for a word in pages 18 to 23 of an document. I'now ysing the javascript:

var textToSearch = app.response("Enter the search term:");

if (textToSearch!="") search.query(textToSearch, "ActiveDoc");

But that is searching the whole document.

TOPICS
PDF forms
702
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 08, 2017 Jul 08, 2017

Only if you use the getPageNthWord method of the document object and build your own function to search for a phrase.

This could be quit slow since it will not use any index.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 09, 2017 Jul 09, 2017
LATEST

Another option is to extract those pages as a new file and then search them.

This will only work in Acrobat, of course.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines