Mobile Viewer searching "end of document" message

32 views
Skip to first unread message

Matt Parizeau

unread,
Aug 22, 2014, 2:06:03 PM8/22/14
to pdfnet-w...@googlegroups.com
Q:

Currently in the web viewer when you search for a word that cannot be found in the document then there is an alert shown. We'd prefer not to show alerts, so is there a simple solution to wrap the search to the beginning of the document instead?

A:

If you want to modify what is displayed when the search reaches the end of the document then you can modify the searchText function in MobileReaderControl.js. Look for the line in that function: alert(i18n.t("endOfDocument"));. This is the line that displays the alert so you can modify it to instead display your own message.

If you wanted to loop the search then you could have this instead: 
setTimeout(function() {
    me.searchText(pattern, searchUp);
}, 0);
However be aware that this will loop forever if the search term isn't found in the document so you would have to do something a bit smarter to make sure that doesn't happen.
Reply all
Reply to author
Forward
0 new messages