Docs PDFiumVCL

SelectionCharCount function

Cette entrée API conserve identifiants, signatures, blocs de code et termes PDF dans leur forme d’origine.
Component: TPdfView  ·  Unit: PDFium
Returns the total number of characters currently selected.

Syntax

function SelectionCharCount: Integer;

Description

Sum of the character counts across all per-page selection ranges. In single-page selection mode this is just the one range's length; in spread cross-page selection it is the sum across both ranges.

Counts PDF character positions, not text-string code points after extraction — ligatures and generated characters (e.g. an auto-inserted CR/LF between visual lines) count as their underlying PDF character slots, matching the indices returned by CharacterIndexAtPos.

Remarks

Example

StatusBar1.SimpleText :=
  Format('Selected: %d characters', [PdfView1.SelectionCharCount]);

See Also

HasSelection, SelectedText, OnSelectionChange