PDFium Delphi Component Docs

BeginPageObjectEditTransaction method

Component: TPdf  ·  Unit: PDFium
Starts a reproducible page-object edit transaction on the active document

Syntax

procedure BeginPageObjectEditTransaction(AllowSignedDocument: Boolean = False);

Description

BeginPageObjectEditTransaction captures a bounded, reproducible snapshot of the active document and enters the transaction state in which page-object edits are journalled instead of being applied directly

By default the call refuses a document that carries signatures; pass AllowSignedDocument = True to open the transaction anyway when the caller accepts responsibility for invalidating existing signatures

Remarks

    • Track progress through PageObjectEditTransactionStatus while the transaction is open
    • Call CommitPageObjectEditTransaction to apply the journalled edits or RollbackPageObjectEditTransaction to restore the snapshot
    • Nested transactions are not supported; begin the next one only after committing or rolling back

Example

Wrap a group of object edits so they can be undone as one unit

Pdf1.BeginPageObjectEditTransaction;
try
  Pdf1.SetTextObjectFontSize(3, 14);
  if not Pdf1.CommitPageObjectEditTransaction then Pdf1.RollbackPageObjectEditTransaction;
finally
  Pdf1.UpdatePage(1);
end;

See Also