Frameworks
Integrations
Mendix
SharePoint
Modular UI
Legacy UI
AnnotationManager
Annotation Types
Customize
Version 11
Version 10
v10.12
v10.11
v10.10
v10.9
v10.8
v10.7
v10.6
v10.5
v10.4
v10.3
v10.2
v10.1
v10.0
Version 8
v8.12
v8.11
v8.10
v8.9
v8.8
v8.7
v8.6
v8.5
v8.4
v8.3
v8.2
v8.1
v8.0
Version 7
Version 6
v6.3
v6.2
v6.1
v6.0
Version 5
Version 4
Version 3
Version 2
WebViewer Server
WebViewer BIM
Besides the basic text search functions from WebViewer UI, WebViewer provides methods for more low level control of text search. They are:
textSearchInit
: Start a search or search for the next occurrence of a search termclearSearchResults
: Clear highlighted search resultsdisplaySearchResult
: Highlight result, unhighlight previous resultdisplayAdditionalSearchResult
: Highlight additional resultsetActiveSearchResult
: Go to search result and highlight it with 'active' colorsetSearchHighlightColors
: Set highlight colors of search resultssearchInProgress
: Event fired when a search starts or endsThe textSearchInit
function is used to start a text search and the displaySearchResult
, displayAdditionalSearchResult
, and setActiveSearchResult
functions are used to highlight the results. An example of textSearchInit
being used can be seen below:
In the above code the textSearchInit
method is used to search the document. It takes the following input parameters:
searchPattern
: A pattern to search formode
: A number that encodes the search options, generated by bitwise ORing options togethersearchOptions
: An object that contains the search options.searchCallBack
: A callback function that get called when a match has been found or at the end of document (or when using PAGE_STOP
, at the end of a page)The 'mode' value it takes in can be created by doing bitwise OR operations on the different SearchMode
properties. The search modes are:
CASE_SENSITIVE
: Text must match the case of the search termSEARCH_UP
: Search starts on the last page, and search backwards to first pagePAGE_STOP
: Search will invoke the callback function when it finishes searching a pageHIGHLIGHT
: Bounding box of found term will be includedAMBIENT_STRING
: Characters surrounding the search term will be includedWHOLE_WORD
: Text must be a whole wordREGEX
: Search text can contain regular expressionsWILD_CARD
: Search text can contain wildcardsWhen the callback function is called, it receives a SearchResults
object that has a few useful properties. It has a 'resultCode' property, which has one of the following values
ResultCode.PAGE
: Reached the end of a pageResultCode.FOUND
: Found a matchResultCode.DONE
: Done searching the documentThe searchResults
will also have a 'quads' property that contains an array of textQuad objects. You can call the getPoints
function on textQuad objects to receive a Quad
object.
Did you find this helpful?
Trial setup questions?
Ask experts on DiscordNeed other help?
Contact SupportPricing or product questions?
Contact Sales