THPDFFormEditSession Class
Groups loaded AcroForm edits into one transaction with undo history, dirty-field tracking, regenerated appearances, and constrained event actions
Declaration
THPDFFormEditSession = class(TObject)
public
function SetFieldValue(const FieldName, Value: AnsiString): Boolean;
function Undo: Boolean;
function Redo: Boolean;
procedure BindEventAction(const FieldName: AnsiString;
EventKind: THPDFFormEventKind;
const Action: THPDFConstrainedFormAction);
function DispatchEvent(const FieldName: AnsiString;
EventKind: THPDFFormEventKind;
out AResult: THPDFFormEventResult): Boolean;
procedure Commit;
procedure Rollback;
function DirtyFieldCount: Integer;
function DirtyFieldName(Index: Integer): AnsiString;
property Closed: Boolean read FClosed;
end;
Unit
HPDFDoc
Creation
Sessions are created by THotPDF.BeginLoadedFormEditSession for a loaded document containing at least one form field, and the caller owns and frees the returned session
Usage notes
SetFieldValuerecords history, marks the field dirty, and regenerates its appearance streamUndoandRedomove through session history,Rollbackrestores every original value, andCommitretains the current valuesBindEventActionandDispatchEventsupport constrained focus, pointer, key, and commit actions without evaluating JavaScriptDirtyFieldCountreports how many fields hold uncommitted edits andDirtyFieldNamereturns the zero-based indexed dirty field name for reporting or selective commit decisionsClosedbecomes true afterCommitorRollbackends the transaction, and further edits are rejected