TPDFlibSearchPanel

Viewer

Description

TPDFlibSearchPanel (unit Lib\PDFlibViewer.pas, added in v3.127.0) is a search panel for TPDFlibViewer. RunSearch fills the list with one row per hit across the whole document, displayed as p<page>: <matching text>; clicking a hit navigates the attached viewer to the hit's page

Syntax

Delphi

Function RunSearch(Const Query: WideString;
  CaseSensitive: Boolean= False): Integer;
Property LastQuery: WideString;
Property HighlightInView: Boolean;

The binding and row surface (AttachViewer, ItemCount, ItemText, ItemData, Viewer) is inherited from TPDFlibViewerPanel

Key members

RunSearchSearches the attached document and lists the hits; returns the total number of hits found without a fixed result cap. An empty query clears the list
LastQueryThe query text of the most recent RunSearch
HighlightInViewWhen True (the default, since v3.216.0) every hit also gets a translucent bar painted in the attached viewer, like HighlightSearchHits

Remarks

Rows stay listed after navigation, so the panel doubles as a result browser; the viewer's own HighlightSearchHits / ClearSearchHighlights manage the painted bars independently when the panel's HighlightInView is turned off

See also

TPDFlibViewerPanel, TPDFlibViewer, HighlightSearchHits, TPDFlibOutlineViewer, TPDFlibThumbnailBar