how to clear highlighted text of search result?

64 kali dilihat
Langsung ke pesan pertama yang belum dibaca

s.crandall

belum dibaca,
27 Apr 2016, 13.59.0727/04/16
kepadaPDFTron WebViewer
I would like to define an event where the highlighted text is cleared if the user clicks outside of the search input field.  I am using the current downloaded trial version of WebViewer Client (4/20/16).  Is the method "setToolMode(tool)" the correct one to use?  Could you please provide sample code so that I can learn how to implement this method?  Thank you for your help!  -Suzanne

Kristian Hein

belum dibaca,
27 Apr 2016, 16.12.4027/04/16
kepadaPDFTron WebViewer
Hello,

By highlighted text, do you mean a highlighted search result or do you mean the text in the search input field?

If it is the prior, then the highlighted text is cleared by clicking with most tools, for example, the text selection tool. Pan and signature tools will keep the selection.

s.crandall

belum dibaca,
28 Apr 2016, 12.20.2928/04/16
kepadaPDFTron WebViewer
Yes, I mean the highlighting on the text that results from a search.  Thank you for your suggestion, however the custom UI toolbar I am working with does not make use of other "tools" that will "clear" the highlighting when clicked.  I've included a screen shot below.  I need to code an event that clears (or "resets") the highlighting when the user clicks anywhere in the viewport outside of the input field.  Could you please help me with some sample code?  Thank you for your help!  -Suzanne


Kristian Hein

belum dibaca,
28 Apr 2016, 14.57.0028/04/16
kepadaPDFTron WebViewer

You can clear the highlighted text when clicking outside of the search box by adding this code to ReaderControl.js

$('#searchBox').on('blur', function() {
    readerControl.docViewer.clearSelection();
});
Balas ke semua
Balas ke penulis
Teruskan
Pesan telah dihapus
0 pesan baru