PDFiumPas Docs

TryCreateContentEventCursor method

Component: TPdf · Unit: PDFium

Added in internal v3.407.0, updated 2026-11-10

Syntax

function TryCreateContentEventCursor(ObjectBoundary, EventIndex, StreamIndex: Integer;
  out Cursor: TPdfContentEventCursor): Boolean; overload;
function TryCreateContentEventCursor(const ContainerPath: TPdfCharacterSourcePath;
  ObjectBoundary, EventIndex, StreamIndex: Integer;
  out Cursor: TPdfContentEventCursor): Boolean; overload;

Requires an active BeginPageObjectEditTransaction(False, True) on the current page; output fields are read-only by contract and bind the cursor to this TPdf instance, transaction, page, container path and native ledger revision

ObjectBoundary is before a native object or equals ObjectCount at the end; EventIndex is before an event or equals EventCount; StreamIndex selects the original stream slot, including empty slots

Creation checks bounds, adjacent event ordering and an unchanged revision; the native splice additionally checks neighbouring paint-object stream order, matching scopes and supported membership before mutation

Create fresh cursors after every successful ledger splice or native-object removal; rollback, commit and a new transaction invalidate all old cursors even when native revision numbers coincide

The record names this binding TransactionId: it stores the page-object edit serial of the creating transaction, and a cursor whose TransactionId no longer matches the active serial is rejected as belonging to another transaction even when Owner and PageNumber still agree

Transaction and availability

An empty ContainerPath selects the current page; a nonempty path selects a private Form invocation using a page-object index followed by Form child indexes, all zero-based, with depth at most 64

These optional native procedures are included in the internal v3.407.0 bundled modules; external older DLLs still load, queries return False and mutation attempts reject when the required extension is absent

Failed state reads clear Revision to zero and counts to minus one; failed event reads clear handles and paths, use cekUnknown and set boundary, stream, parent and match to minus one; failed cursor creation clears ownership and sets boundary, event and stream to minus one

Logical availability does not promise that every graphics style can be regenerated; mutations join one deferred preserving transaction, and a failed commit restores its snapshot without falling back to ordinary generation

The bounded profile allows 64 open scopes, 16 MiB of captured scalar/key/tag bytes, 262144 direct node/entry visits and parameter-tree depth 32; paragraph metadata scans have a separate 1048576-unit work budget

Internal v3.410.0 adds the separate RebindContentEvent method for a reviewed page-scoped MCID owner or number change; it retains the target element role, requires a fresh page cursor and restores the whole batch after post-acceptance failure

See also

TryGetContentEvent, BeginPageObjectEditTransaction, TryGetContentEventEditState, TryGetContentEventForEdit, InsertContentEvent, RemoveContentEvent