THPDFHeadlessDocument.OpenAuthenticatedSuccessor

Opens an appended revision that extends this authenticated source whilst borrowing its verified encryption identity

function OpenAuthenticatedSuccessor(const FileName: string;
  const CopyOptions: THPDFHeadlessDocumentOptions): THPDFHeadlessDocument;

The successor must begin with every byte of the authenticated source and may only append bytes after them; the appended bytes are the successor's own revision, and a file that merely shares a prefix or rewrites an earlier byte is rejected

The caller receives a fully owned THPDFHeadlessDocument instance that owns its own source stream and derived security state; destroying the source document before the successor is allowed

Admission

The current authenticated source must still hash to the identity captured when it was loaded, so a source file whose bytes changed after loading cannot validate a successor

All pending edits must be published first: a dirty trailer, replacement objects or generated bytes raise hdInvalidDocument before any successor is derived

The successor's trailer must still reference the same encryption dictionary and the same permanent file identifier (the first /ID element); the modification identifier may legitimately change in an appended revision, and a source without /ID may stay without one

The successor path must be nonempty and contain no NUL, and must not alias the loaded source file; an aliased path raises hdSourceDestinationAlias

Limits and lifetime

CopyOptions budgets are validated by the ordinary constructor before the successor file is opened, and the successor size is bounded by MaxFileBytes

The successor owns its cancellation tokens and loaded revision; failure frees the partially built successor and restores the source position and options

Authenticated security copies · OpenAuthenticatedCopy · THPDFHeadlessDocument