PDFium Delphi Component Docs

HighlightSearchText method

Component: TPdfView  ·  Unit: PDFium
Replaces the current page's search highlight set with every match for one query

Syntax

function HighlightSearchText(const Text: WString; MatchCase: Boolean= False; MatchWholeWord: Boolean= False): Integer;

Description

The method scans the active page with the requested case and whole-word options, then replaces the existing search highlight set with each matching character range for alpha-blended drawing

The return value is the number of unique ranges found for this query, or 0 when the view is inactive, the text is empty, or no match exists

Remarks

Example

Matches := PdfView1.HighlightSearchText('invoice', False, True);
PdfView1.AddSearchTextHighlight('overdue');

See Also

AddSearchTextHighlight, ClearHighlight, HighlightColor