PDFiumVCL Docs

HasSelection function

Component: TPdfView  ·  Unit: PDFium
Returns whether any text is currently selected in the viewer.

Syntax

function HasSelection: Boolean;

Description

Returns True if the viewer's internal selection model contains any non-empty range, otherwise False. Cheap (no PDFium round-trip) so it's safe to call from OnSelectionChange handlers, from a popup's OnPopup to enable / disable a Copy item, or from a paint loop.

Remarks

Example

CopyMenuItem.Enabled := PdfView1.HasSelection;

See Also

SelectionCharCount, SelectedText, SelectAll, ClearSelection, OnSelectionChange