THPDFHeadlessDocument.SaveToFile
Unit: HPDFHeadlessDocument
procedure SaveToFile(const FileName: string);
Save an independent incremental PDF by copying the original bytes and appending dirty objects, a classic xref table and a Prev-linked trailer
Rejects aliases of the source path or file identity; an exclusive same-directory staging file is flushed and renamed atomically, preserving an existing destination on cancellation, limit or serialisation failure
Windows publication uses bounded, cancellable retries for transient access-denied, sharing and lock errors whilst keeping atomic replacement, permanent-failure diagnostics and staging cleanup
Windows atomic publication documents the eight-attempt limit and the actual file-handle acceptance