PDFium Component Docs

SelectedText function

Component: TPdfView  ·  Unit: PDFium
Returns the currently selected text as a wide string.

Syntax

function SelectedText: WString;

Description

Extracts the text covered by the active selection through FPDFText_GetText and returns it as a Unicode string. For a cross-page selection, the per-page slices are joined in page order with a #13#10 (CR/LF) separator so the reconstructed text reads like ordinary multi-line content.

Returns an empty string when nothing is selected.

Remarks

Example

ShowMessage(string(PdfView1.SelectedText));

See Also

HasSelection, SelectionCharCount, CopySelectionToClipboard