THotPDF.PrepareLoadedFormDataRevisionToStreamWithLoadedCredential
Prepares a private revision of the actual loaded graph without changing the original document, reusing the credential the loaded document authenticated with
Declaration
procedure PrepareLoadedFormDataRevisionToStreamWithLoadedCredential(
Destination: TStream; const Password: AnsiString;
MaxWorkingBytes, MaxOutputBytes: Int64; MaxObjects: Integer;
Checkpoint: TNotifyEvent; OriginalSource: TStream;
out AuthenticatedRevision: THotPDF);
Behavior
The method copies the original revision to an exclusively created private file, loads a separate incremental document, compares semantic object graphs by object number and generation, clones actual pending changes, and writes the resulting candidate at the current destination position
Text values, existing appearances, unrelated pending catalog changes, indirect references, stream contents, and new graph objects participate in preparation; PDF names are decoded once and duplicate semantic dictionary names are invalid
An unchanged graph copies the exact original bytes without adding an empty incremental cross-reference section; changed graphs retain the complete original byte prefix and append their current revision
Encrypted revisions retain their original encryption dictionary and key; this overload reuses the credential the loaded document itself authenticated with, so the ordinary password re-entry on the credential document is not repeated
Password is still compared against the load password and the prepared revision is re-verified against the actual bytes before the borrowed credential decrypts anything, so a mismatched revision is refused rather than decrypted; Password is exactly the caller's password only when it equals the password this document was loaded with
On success AuthenticatedRevision receives a newly created, independently owned THotPDF revision that is authenticated with the reused credential; free it when the caller is done, because the prepared revision is not retained by this document
OriginalSource, when supplied, must be the complete immutable original revision from which this document was loaded, including ciphertext and signed bytes; its position is restored on success and failure
MaxWorkingBytes must be at least 1 MiB; MaxOutputBytes and MaxObjects must be positive; source copying, object comparison, resident and spilled clone data, and output length have finite bounds
OperationCancellationToken and Checkpoint are polled during copying and comparison; copying uses blocks no larger than 64 KiB; a failed preparation can leave partial destination bytes, which the caller must discard, and AuthenticatedRevision is nil
This low-level method prepares a graph revision and does not authorize pending changes under DocMDP or FieldMDP; use THPDFWindowsFormDataTransaction to authenticate signature policy before publishing form updates
The original THotPDF graph, source ownership, pending changes, and settings remain intact when preparation succeeds or fails; temporary files are closed and removed when the method exits
Related topics
PrepareLoadedFormDataRevisionToStream, THPDFWindowsFormDataTransaction, Windows FDF/XFDF exchange