HighlightSearchHits
Viewer interaction, text
Description
Searches the whole document for the query and paints every hit with a translucent bar in SearchHighlightColor that stays visible while scrolling, zooming and rotating
Hits are streamed page by page and converted to top-down page coordinates; previous hits are cleared before the search starts, and an empty query only clears them
Syntax
Delphi
Function TPDFlibViewer.HighlightSearchHits(Const Query: WideString; CaseSensitive: Boolean= False): Integer;Parameters
| Query | Text to search for; an empty query just clears the previous hits |
|---|---|
| CaseSensitive | True compares case sensitively, the default is False |
Return values
| 0 | No hit was found, the query is empty or no document is open |
|---|---|
| Positive value | Number of hits found and highlighted |
See also
TPDFlibViewer, ClearSearchHighlights, GetTextInRegion, SearchTextEach