function CopySelectionToClipboard: Boolean;
On Windows, pulls the current selection through SelectedText and writes it onto the clipboard as CF_UNICODETEXT via OpenClipboard / EmptyClipboard / GlobalAlloc / SetClipboardData. Returns True on success
Returns False when there is no selection to copy, when SelectedText resolves to the empty string, or when a Win32 clipboard call fails, including memory allocation or unavailable access
Since v3.126.0, Windows clipboard opening uses a bounded 100ms retry budget for transient contention without pumping UI messages; access that remains unavailable still returns False
Native Free Pascal/LCL on Linux and macOS uses the widget set's UTF-8 text clipboard interface and converts from the component's UTF-16 selection. The Windows clipboard retry budget applies only to the Windows implementation; native clipboard access requires an available desktop clipboard service
Ctrl+C keystroke and to the default Copy popup menu item when AllowUserTextSelection = True and no form field has focusCloseClipboard after a successful open, allowing other applications to read the copied data
if not PdfView1.CopySelectionToClipboard then
ShowMessage('Nothing selected, or clipboard unavailable.');