THPDFWindowsFormDataTransaction.RemoveAnnotations method

procedure RemoveAnnotations(
  const Identities: array of THPDFHeadlessAnnotationIdentity;
  const Options: THPDFHeadlessAnnotationRemovalOptions;
  const Password: AnsiString);

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

The transaction must have been constructed with the actual original source corresponding to the loaded document and the password needed to authenticate encrypted input

ChangedAnnotations reports the number removed, including cascade dependencies; the counter uses the transaction's existing prepared-change storage

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

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

A failure or cancellation means discarding the transaction and retaining the borrowed document and source; a transaction that already has a prepared candidate rejects another preparation

With zero removals the output is the exact current prepared revision, including pending loaded-document state represented by the transaction; it is not necessarily the original disk file if the caller had unsaved changes

Limits and identity

Page and name selection, dependency cascades, ambiguity checks and the Widget boundary follow native annotation removal

An explicitly supplied cancellation token must be the transaction's token; the transaction caps MaxWorkingBytes at half its working capacity and MaxAnnotations at its object capacity

The method preserves positive-capacity checks, encrypted annotation permissions and authenticated signature-policy admission; the password is not an authorization bypass

See ordinary Windows removal and THPDFWindowsFormDataTransaction for ownership and lifecycle details