Annotation removal JSON and callback operations

The Windows and native Linux C ABI operation entry points accept annotations.remove; request JSON selects annotations, whilst PDF bytes travel through callback IO rather than being embedded in JSON

{
  "schemaVersion": 1,
  "type": "annotations.remove",
  "annotations": [{"page": 0, "name": "review-note"}],
  "annotationLimits": {
    "maxAnnotations": 4096,
    "maxOperations": 1000000,
    "maxNameBytes": 1048576,
    "maxWorkingBytes": 33554432
  }
}

annotations must be an array of objects containing an integer page within the actual input document and a nonempty string name; names match decoded Unicode NM exactly

An empty array or unmatched valid identities is a no-op; duplicate selectors, ambiguous selected names, malformed annotation ownership and Widget selection fail

Input and publication lifecycle

Without input IO, removal operates on the handle's current committed document; explicit input IO supplies an independent PDF and is staged privately rather than replacing the current context before the operation succeeds

Supply password where authentication of encrypted input requires it; actual annotation permission and signed-document policy still apply

PDF output IO and result IO are separate sinks; the engine prepares the candidate, publishes its PDF, publishes the bounded JSON result, checks cancellation, and only then replaces the handle's current document

A read, write, result-publication, policy, budget or cancellation failure retains the previous committed context and permits a normal retry on that handle

A callback sink can already contain bytes when a later write, result callback or cancellation fails; context rollback cannot retract those external bytes, so callers must stage and publish their own sinks transactionally

Repeated removal against the committed result returns zero and publishes the exact current revision; compare callback output only once the operation's status has been checked

Result and limits

A successful result has schemaVersion: 1, statusCode: 0, status: "ok", removed, mediaType: "application/pdf" and annotationProfile: "page-and-nm-removal-v1"

removed includes popup and reply cascades, counting each annotation once even when dependencies form a cycle

annotationLimits lowers the effective positive capacities described by THPDFHeadlessAnnotationRemovalOptions; operation memory, object, page, output, result and elapsed-time limits remain independent

Optional signaturePolicy configures the existing authenticated CMS policy, including required CAdES, timestamps and trust requirements supported by the operation entry point

Actual removals are subject to AES annotation permissions and authenticated certification P1/P2/P3 policy; a successful password check or an unsigned error message is not evidence of permission or trusted certification

On failure, check the returned operation status and the available structured error result; a failed result sink may prevent delivery of a complete error JSON document

See native removal semantics and ordinary Windows file jobs