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

QueryText to search for; an empty query just clears the previous hits
CaseSensitiveTrue compares case sensitively, the default is False

Return values

0No hit was found, the query is empty or no document is open
Positive valueNumber of hits found and highlighted

See also

TPDFlibViewer, ClearSearchHighlights, GetTextInRegion, SearchTextEach