function SelectAllFormText: Boolean;
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 is made, meaning the
focused widget has at least one character, and False
otherwise. It also returns False safely when the view
is inactive, the document has no AcroForm, or no widget is
focused.
The usual companion to GetSelectedFormText is a
Copy All command: SelectAllFormText highlights every character in
the focused widget, then GetSelectedFormText returns those
characters as a WString ready for the clipboard.
FormField[i] := FormField[i]; — PDFium collapses the selection to a caret when the value changes.
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;