PDFium Delphi Component Docs

Incremental save session

コンポーネント: TPdf  ·  ユニット: PDFium
以前のすべての出力バイトを保持しながら、変更または新しい間接オブジェクトのみを追加します

構文

procedure BeginIncrementalSave(AllowSignedDocument: Boolean = False);

function CommitIncrementalSave(Stream: TStream; out Info: TPdfIncrementalCommitInfo): Boolean;

function CommitIncrementalSave(const FileName: string; out Info: TPdfIncrementalCommitInfo): Boolean;

procedure EndIncrementalSave;

property IncrementalSaveActive: Boolean;

AllowSignedDocumentExplicitly permits a session on a signed document; the default rejects it
StreamTStream that receives the complete accumulated PDF after this commit
FileNameOutput path replaced only after a sibling temporary file succeeds
InfoPer-commit statistics returned after the destination write succeeds

コミット情報

ChangedObjectCountNumber of changed or new indirect objects appended by this commit
AppendedByteCountBytes appended after the exact previous-output prefix
OutputByteCountTotal bytes in the complete output returned by this commit
RevisionCountNumber of non-empty revisions committed in the current session

説明

BeginIncrementalSave は安定した PDFium セマンティックスナップショットを、比較ベースラインと最初の完全出力の両方としてキャプチャします

各コミットは現在の状態をキャプチャし、アクティブなクラシック、ハイブリッド、xref ストリーム、オブジェクトストリームのオブジェクトを解決し、オブジェクト世代と正確な本体バイトを比較します

変更または新しい間接オブジェクトのみが以前の出力の後に書き込まれ、その後、最小限の xref とトレーラーリビジョンが続きます

クラシック xref ソースはクラシック xref テーブルで続き、xref ストリームソースは自己インデックス xref ストリームで続きます

何も変わらない場合、以前の出力がバイト単位で返され、リビジョンは追加されず、RevisionCount も進みません

ファイルオーバーロードは兄弟一時ファイルを書き込み、宛先を原子的に置換し、書き込みや置換が失敗した場合はセッション状態を復元します

制約

var
  Info: TPdfIncrementalCommitInfo;
begin
  Pdf.BeginIncrementalSave;
  try
    Pdf.PageNumber := 1;
    Pdf.PageRotation := ro90;
    Pdf.CommitIncrementalSave('revision-1.pdf', Info);
    Pdf.PageRotation := ro180;
    Pdf.CommitIncrementalSave('revision-2.pdf', Info);
  finally
    Pdf.EndIncrementalSave;
  end;
end;

関連項目

SaveAs, SaveAsObjectStream