Skip to main content
Known Participant
October 19, 2017
Question

custom search with javascript?

  • October 19, 2017
  • 1 reply
  • 441 views

Hi I want to do a search in a pdf file, I want to look for a name and then to perform the search I pull an ordered list of all the times that name appears. I did it with advanced search but the list is very confusing ... is there any code to do this?

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
October 19, 2017

Yes, but if the name is more than one word long it gets complicated.

Basically, you would need to create a loop over all the words in all the pages of the file, using the getPageNthWord method of the Document object, searching for the word(s) you're interested in. Also, this is quite a memory-intensive process and the application tends to choke if your file is very long.

DEMAuthor
Known Participant
October 19, 2017

ok thanks a lot and can you generate a custom dialog box to perform a search? where say say the name and name and there the user put the name you want to search and get the reusltado in a list?

try67
Community Expert
Community Expert
October 19, 2017

It's possible, but quite complicated to implement.