PDFium Delphi Component Docs

PageObjectEditTransactionStatus property

Component: TPdf  ·  Unit: PDFium
Reports whether a page-object edit transaction is active and how far it has progressed

Syntax

property PageObjectEditTransactionStatus: TPdfPageObjectEditTransactionStatus; // read only

 

type TPdfPageObjectEditTransactionStatus = record
  Active: Boolean;
  Dirty: Boolean;
  PageNumber: Integer;
  MutationCount: Integer;
  ContentGenerationCount: Integer;
end;

ActiveTrue between BeginPageObjectEditTransaction and the matching commit or rollback
DirtyTrue once at least one mutation ran inside the transaction
PageNumberOne-based page the transaction was bound to when it began
MutationCountSuccessful UpdatePage calls recorded inside the transaction
ContentGenerationCountContent generations performed when committing dirty transactions

Description

A page-object edit transaction defers native content generation so that page-object insert, remove, transform, property, content-mark and annotation-appearance mutations apply as one atomic page-scoped operation. This property exposes its live state for guards and diagnostics

MutationCount advances with every successful deferred mutation, and each such mutation also invalidates the page caches so no stale render, snapshot or thumbnail survives the edit

Committing a dirty transaction regenerates the page content once and advances ContentGenerationCount. Committing a no-op transaction or rolling back restores the baseline without generation

Remarks

Commit and rollback clear Active and Dirty but leave PageNumber and both counters as final diagnostics until the next transaction begins and resets them

Outside a transaction every field holds its default value, so Active = False is the reliable idle test

The status covers page-object transactions only; document-level transactions opened with BeginEditTransaction are reported by the edit journal

Example

Pdf.BeginPageObjectEditTransaction;
try
  Pdf.TransformPageObject(0, Matrix);
  Status := Pdf.PageObjectEditTransactionStatus;
  LogTransactionProgress(Status.MutationCount, Status.Dirty);
  Pdf.CommitPageObjectEditTransaction;
except
  if Pdf.PageObjectEditTransactionStatus.Active then
    Pdf.RollbackPageObjectEditTransaction;
  raise;
end;

See Also

PageObjectEditTransaction, BeginEditTransaction, CommitEditTransaction, RollbackEditTransaction, UpdatePageObject