THPDFHeadlessDocument.OpenAuthenticatedCopy
Opens a second independently owned document from the same file bytes while borrowing the already verified authentication of this document
function OpenAuthenticatedCopy(const FileName: string;
const CopyOptions: THPDFHeadlessDocumentOptions): THPDFHeadlessDocument;
The caller receives a fully owned THPDFHeadlessDocument instance with its own derived security state; destroying the copy clears its authentication material independently of the source document
Admission
The copy re-verifies the encryption dictionary body and the permanent file identifier against the actual bytes of the target file before the borrowed credential is accepted, so a file that merely shares a prefix cannot inherit authentication
An explicit password in CopyOptions keeps the ordinary password-authentication path; borrowing only follows library-verified identity, never a caller assertion
Lifetime
The copy owns its cancellation tokens and loaded revisions; the source document may be destroyed before the copy
External bytes and wrong or empty passwords never inherit a cached credential; Authenticated security copies documents the security-state cloning used internally