HPDFXFDFExportAnnotations function

function HPDFXFDFExportAnnotations(const Access: THPDFXFDFAccess;
  const Destinations: THPDFXFDFDestinationAccess; MaxBytes, MaxAnnotations: Integer;
  CancellationToken: THPDFCancellationToken; out Bytes: TBytes): Integer; overload;

Export mapped annotations as UTF-8 XFDF and return their count, using the separate destination record to map actual page references to zero-based indices

Named and explicit destinations and local GoTo actions use the bounded destination profile; nonnumeric, out-of-document or malformed targets fail the operation

Existing overloads retain their signatures and use an empty destination record; provide explicit callbacks when exported annotations contain page-array targets

Stream metadata is exported only when the relevant PDF key exists and ResolveStream is supplied; an omitted optional stream resolver does not prevent other mapped annotation attributes from being exported

The shared codec's byte and annotation limits do not replace native graph admission and authenticated signature policies; prefer HPDFExportHeadlessAnnotationsXFDF for a loaded native document

Standard stamp appearance transport preserves actual Form streams and bounded acyclic font, image and graphics resources through base64 typed XML

function HPDFXFDFExportAnnotations(const Access: THPDFXFDFAccess;
  const Destinations: THPDFXFDFDestinationAccess;
  MaxBytes, MaxAnnotations, MaxAppearanceNodes, MaxAppearanceDepth: Integer;
  MaxAppearanceWorkingBytes: Int64; CancellationToken: THPDFCancellationToken;
  out Bytes: TBytes): Integer; overload;

The appearance limits apply cumulatively across selected stamps; MaxAppearanceDepth is in 1..62 and all limits must be positive

The previous bounded overload supplies 100000 appearance nodes, depth 62 and a working reservation of MaxBytes multiplied by 32; native document admission applies additional independent limits

Before copying annotation keys or converting a stamp resource graph, the bounded adapter reserves their original encoded key lengths and the complete expanded graph, including payload copies and escaped XML output; shared resources are charged for each expanded occurrence

The working reservation is conservative and cumulative for the operation, independent of the final output byte limit; caller-owned source objects and streams remain outside this additional reservation