THPDFWindowsFormDataTransaction.RemoveFormFields method

procedure RemoveFormFields(const FieldNames: array of UnicodeString;
  const Options: THPDFHeadlessAnnotationRemovalOptions;
  const Password: AnsiString);

Prepares one AcroForm field-tree removal candidate through the native authenticated engine without mutating the transaction's borrowed THotPDF document

Construct the transaction with the actual original source corresponding to the loaded document and the password needed to authenticate encrypted input

FieldNames selects exact, decoded Unicode complete field names; an ancestor includes every terminal field and Widget in its subtree

ChangedFields reports removed terminal fields, including fields selected through an ancestor; Widgets and structural ancestors do not add to this count

Preparation and ownership

After preparation, WritePreparedPDF copies the bounded candidate to a destination stream; call TakeCandidate only after all required PDF and result publication succeeds

TakeCandidate transfers the new THotPDF and its owning THPDFWindowsFormDataSource; destroy the document before its source

A transaction that already has a prepared candidate rejects another preparation; discard a failed transaction and retain the borrowed document and source

With zero removals the output is the exact current revision represented by the transaction, including pending loaded-document state; it can differ from the original disk file when the caller has unsaved changes

Limits and policy

An explicitly supplied cancellation token must match the transaction's token; effective MaxWorkingBytes is capped at half the transaction's working capacity, and MaxAnnotations is capped at its object capacity

All positive-capacity checks, encrypted structure permissions and authenticated signature-policy requirements remain active; the password does not bypass them

Selection, ownership, read-only fields, signed signature fields, certification and field locks follow native field-tree removal

See THPDFWindowsFormDataTransaction for ownership and lifecycle details, and JSON and callback operations for publication and rollback