PDFium Delphi Component 文件

SaveAsReproducible 方法

组件: TPdf  ·  单元: PDFium
重写文档,使同一内存状态的两次保存产生字节相同的输出

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

对象顺序已经稳定(对象号递增),内容哈希 /ID 派生是确定性的,因此剩余的非确定性是 PDFium 写入 /Info 的墙上时钟 /CreationDate 和 /ModDate

StripDictionaryEntries 从 /Info 主体移除这些时间戳键,重建的 trailer 省略源 /ID(它派生自带时间戳的字节)

不可达对象也像 SaveAsReachable 一样被清扫,对象号和代次保持稳定

Policies and limits

Example

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

See Also

SaveAsReachable, SaveAs, SaveAsDeduplicated