function FormUndo: Boolean;
FormUndo is a high-level wrapper around PDFium's
FORM_Undo entry point. The PDFium API was already bound
at the unit level but had no high-level accessor until v1.23.0; this
method exposes per-widget undo to applications.
Each AcroForm widget maintains its own undo / redo stack inside PDFium's form-fill engine. Typing into a text field, deleting characters, paste, autocomplete — every change becomes a new undo entry. FormUndo rolls one step back on the FOCUSED widget; it does NOT undo across multiple widgets at once.
Returns True on success, False when
there is nothing to undo (the focused widget's undo stack is empty)
or when the view is inactive / has no focused widget. Pair with
FormCanUndo to drive an Undo menu item's
Enabled state.
procedure TForm1.miUndoClick(Sender: TObject);
begin
if PdfView1.FormCanUndo then
PdfView1.FormUndo;
end;
procedure TForm1.miEditMenuClick(Sender: TObject);
begin
miUndo.Enabled := PdfView1.FormCanUndo;
miRedo.Enabled := PdfView1.FormCanRedo;
end;