PDFium Delphi Component Docs

HasSelection function

Component: TPdfView  ·  Unit: PDFium
Returns whether the viewer currently has any selected text

Syntax

function HasSelection: Boolean;

Description

Returns True if the viewer's internal selection model contains any non-empty range, otherwise False. This is lightweight (no PDFium round-trip), so it is 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