PDFium Delphi Component Docs

SaveAsReproducible method

Component: TPdf  ·  Unit: PDFium
Rewrites the document so that two saves of the same in-memory state produce byte-identical output

Syntax

function SaveAsReproducible(Stream: TStream; out Report: TPdfReproducibleReport; AllowSignedDocument: Boolean = False): Boolean;

function SaveAsReproducible(const FileName: string; out Report: TPdfReproducibleReport; AllowSignedDocument: Boolean = False): Boolean;

Description

Object order is already stable (ascending object number), and the content-hash /ID derivation is deterministic, so the remaining non-determinism is the wall-clock /CreationDate and /ModDate which PDFium writes into /Info

StripDictionaryEntries removes those timestamp keys from the /Info body, and the rebuilt trailer omits the source /ID (which derives from time-stamped bytes)

Unreachable objects are also swept exactly like SaveAsReachable, and object numbers and generations stay stable

Policies and limits

Example

Pdf.SaveAsReproducible('stable.pdf', Report);
WriteLn('stripped ', Report.StrippedTimestampCount, ' timestamps');

See Also

SaveAsReachable, SaveAs, SaveAsDeduplicated