THPDFHeadlessAnnotationRemovalOptions record
THPDFHeadlessAnnotationRemovalOptions = record
MaxAnnotations, MaxOperations, MaxNameBytes: Integer;
MaxWorkingBytes: Int64;
CancellationToken: THPDFCancellationToken;
class function Default: THPDFHeadlessAnnotationRemovalOptions; static;
end;
Declared in HPDFHeadlessDocument; initialise the record with Default before changing individual capacities
| Member | Default | Scope |
|---|---|---|
MaxAnnotations | 65536 | Bounds requested identities and the total page-annotation entries scanned across the document, including entries unrelated to the requested names |
MaxOperations | 8000000 | Bounds actual traversal, reference resolution, identity processing, dictionary searches, sorting, dependency expansion and preparation work |
MaxNameBytes | 16777216 | Bounds combined requested names and decoded annotation names, charged at two bytes per Unicode code unit |
MaxWorkingBytes | 134217728 | Bounds removal preparation storage, detached structures and serialisation admission |
CancellationToken | nil | Optional borrowed cooperative cancellation token |
All numeric capacities must be positive; exceeding a valid capacity reports hdLimitExceeded through EHPDFHeadlessDocumentError
Document limits still apply, including file size, object size, decoded storage and reference depth; removal limits do not increase those capacities
If both the document and options provide a cancellation token, they must be the same instance; with no options token, the document's existing token remains effective
The Windows transaction supplies its own shared token and caps removal working memory at half of the transaction's working capacity and annotation count at its object capacity
JSON annotationLimits can lower the effective capacities; values above the surrounding operation's capacity are rejected rather than silently raising the budget
Failure and cancellation leave the native loaded graph and destination unchanged; see callback publication for output sinks that may already have received bytes