I need to search a text in a pdf file.
I have 2 text fields from who i get the values, after a cacul, need to search this value in my opened file.
I can not find the function or method to search the document that value.
The seach.query(); open's a new window. I need just tu search directly.
Thanks for you help
my PDF : http://www.allienys.com/sample/search.pdf
"test with 50 and 100 for 0.5"
The Search object is essentially an interface to the search plug-in in Acrobat / Reader.
If you want to do things within the document, you would have to do it the way plug-in developers have to do it to find something in a document. You parse the document page per page using getPageNthWord() and the word's location using getPageNthWordQuads(). With this information, you can do some further evaluation whether found words fit together (keep in mind that you can not expect to have a logical string of words, representing text as we read it, in a PDF). As a result, you can highlight the found word(s).
Thanks for your help, it's very clear.
I am going to try it.