PDFiumVCL Docs

SelectAllFormText method

Component: TPdfView  ·  Unit: PDFium
Selects every character inside the focused AcroForm widget on the view's active page (the equivalent of Ctrl+A inside the widget).

Syntax

function SelectAllFormText: Boolean;

Description

SelectAllFormText wraps PDFium's FORM_SelectAllText entry point. The PDFium API was already bound at the unit level but had no high-level accessor until v1.23.0; this method gives applications the Ctrl+A-inside-a- widget gesture without subclassing the view.

Returns True when a selection was made (i.e. the focused widget has at least one character) and False otherwise. Returns False safely when the view is inactive, the document carries no AcroForm, or no widget is focused.

The classic pairing with GetSelectedFormText is the Copy-All menu item: SelectAllFormText highlights every character inside the focused widget, then GetSelectedFormText returns those characters as a WString for the clipboard.

Remarks

Example

procedure TForm1.miSelectAllClick(Sender: TObject);
begin
  if PdfView1.SelectAllFormText then
    sbInfo.SimpleText := 'Form text selected'
  else
    sbInfo.SimpleText := 'No focused form widget';
end;

// Copy-all pattern
procedure TForm1.miCopyAllClick(Sender: TObject);
begin
  if PdfView1.SelectAllFormText then
    Clipboard.AsText := string(PdfView1.GetSelectedFormText);
end;

See Also

GetSelectedFormText, FormUndo, FormField