function SelectAllFormText: Boolean;
SelectAllFormText는 PDFium의 FORM_SelectAllText entry point를 감쌉니다. PDFium API는 이미 unit level에서 연결되어 있었지만, v1.23.0 전까지는 high-level accessor가 없었습니다. 이 method는 view를 subclass하지 않고도 application에 widget 내부 Ctrl+A gesture를 제공합니다
selection이 만들어지면 True를 반환합니다. 즉 focus된 widget에 character가 하나 이상 있으면 True이고, 그렇지 않으면 False입니다. view가 inactive 상태이거나 document에 AcroForm이 없거나 widget에 focus가 없을 때도 안전하게 False를 반환합니다
GetSelectedFormText와의 전형적인 조합은 Copy-All menu item입니다. SelectAllFormText가 focus된 widget 안의 모든 character를 highlight한 뒤 GetSelectedFormText가 그 character를 clipboard용 WString으로 반환합니다
SelectAllFormText는 PDFium의 form-fill engine을 통해 document의 JavaScript가 볼 수 있을 수도 있는 form-event를 발생시킵니다FormField[i] := FormField[i];를 다시 할당하세요 — PDFium은 value change 시 selection을 caret으로 접습니다
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;