THPDFHeadlessDocument.SaveEmbeddedAnnotationsFDFToFile method

function SaveEmbeddedAnnotationsFDFToFile(const FileName: string;
  const Bytes: SysUtils.TBytes; const Selection: THPDFFDFChildSelections;
  const Options: THPDFFDFPackageOptions): Integer;

Selects an embedded FDF child that carries an annotation graph, applies it to a prepared incremental revision and atomically publishes the PDF to FileName

Returns the count of changed annotations, with zero for a semantically unchanged import; matching nonempty annotation names remain scoped to their page and identify replacements

Bytes must hold an embedded FDF package and Selection an explicit nonempty child path; the selected child is decoded and re-encoded on its own, because selection never applies an outer package, opens external files or runs scripts

A loaded destination PDF is required, and the document token and the graph-limits token must be a single shared token: two non-nil tokens that differ raise hdInvalidDocument, while a nil graph token adopts the document token

Package and graph limits plus the selected resource budget bound decoding and generated objects; resource graphs, appearance states, string bytes and local action destinations are prepared before publication

An actual change requires annotation permission and authenticated signature-policy admission; malformed data, ambiguous identities, failed allocation and cancellation leave the destination and loaded document unchanged

A successful save also leaves the loaded document unchanged; reload the published PDF to adopt its revision

See SaveAnnotationsFDFToFile for the same import from raw FDF bytes, and native annotation FDF exchange for the supported profile