function FormCanUndo: Boolean;
FormCanUndo wraps PDFium's FORM_CanUndo. It returns
True when the FOCUSED AcroForm widget has at least one
edit in its undo history that FormUndo could roll back,
and False otherwise.
Returns False when the view is inactive, the
document has no AcroForm, or no widget is focused — matching
the contract of the other five form-edit helpers.
The natural use is as the Enabled-state expression for an Undo menu item, toolbar button, or context-menu entry.
procedure TForm1.EditMenuPopup(Sender: TObject);
begin
miUndo.Enabled := PdfView1.FormCanUndo;
miRedo.Enabled := PdfView1.FormCanRedo;
end;