clear previous search text

42 views
Skip to first unread message

Jayaseelan A

unread,
Nov 18, 2015, 12:52:38 PM11/18/15
to PDFTron WebViewer
Hi,

using search text,for eg. enter 'queen' text in full document search box,the searched text highlight on the document as expected,now the problem we are facing is that the search, enter 'testing' is displayed 'No results were found' but the previous search text string highlight on the document.

i have attached error for your reference.

How do i clear previous search text?

Thanks
search.png

Matt Bojey

unread,
Nov 18, 2015, 1:04:39 PM11/18/15
to PDFTron WebViewer
Hi,

You can clear the highlighting by adding this code to you config.js file 

var oldFunction = ReaderControl.prototype.fullTextSearch;
ReaderControl.prototype.fullTextSearch = function(){
    readerControl
.docViewer.clearSelection();
    oldFunction
.apply(this, arguments);
}

Matt
Reply all
Reply to author
Forward
0 new messages