Text search in HTML5 WebViewer on iPad/Android

72 views
Skip to first unread message

Support

unread,
Mar 13, 2012, 6:07:16 PM3/13/12
to pdfnet-w...@googlegroups.com
Q:
 
Could you give me some tips about how to show text search on the iPad and Android visualization of the HTML5 PDF viewer (http://www.pdftron.com/pdfnet/webviewer/demo.html)?
 
----------
 
A:
 
A toolbar could be added to the top of the page with a dialog box for search.  Also a side panel that can be hidden can be used. The sample for the desktop HTML5 viewer contains examples of both of these.

The following function, present in DocumentViewer is used to perform text search.

DocumentViewer.TextSearchInit(pattern, mode, fullSearch, onTextFoundCallback(result,quads), onSearchCanceledCallback)

By default it performs a single search from the page the viewer is currently at, which on completion will call a callback you provide it.

By passing true for “fullSearch”, the entire document will be searched instead, calling the callback after each instance found.

See the sample “ReaderControl.js” to see this function used to perform both full search and single search. Also, please see the documentation (http://www.pdftron.com/pdfnet/webviewer/demo/html5/doc/index.html) for more information.

 

Reply all
Reply to author
Forward
0 new messages