Added in internal v3.404.0, updated 2026-11-10
function TryGetContentEvent(Index: Integer; out Info: TPdfContentEventInfo): Boolean; overload; function TryGetContentEvent(const ContainerPath: TPdfCharacterSourcePath; Index: Integer; out Info: TPdfContentEventInfo): Boolean; overload;
Reads one zero-based source event from the current page or a Form invocation, checking kinds, bounds, scope depths, matching declarations and parent closure
Paths use the same container selection as ContentEventCount; the returned path is a copy rather than an alias
| Field | Meaning |
|---|---|
| Kind | cekBMC, cekBDC, cekEMC, cekMP or cekDP; cekUnknown is the cleared failure value |
| ObjectBoundary | Number of native objects preceding the operator in this container; empty declarations and points need no paint object |
| StreamIndex | Original zero-based content-stream slot in this container |
| ParserOffset | Exclusive native parser position in the concatenated source, including parser separators; not a raw file cut point |
| ParentIndex / MatchingIndex | Source event indexes, or minus one when absent; opener and closer share one exact mark handle |
| Depth | Scope depth before this operator |
| Mark | Borrowed native declaration or point handle; parameter values remain live native objects |
| ContainerPath | Copied Form invocation path, empty for a page |
On False, Kind is cleared to cekUnknown, boundary/stream/parent/matching to minus one, offset/depth to zero, the handle to null and the path to empty
Discard records after any mutation, generation, close or reload; repeated Form invocations carry independent declaration identities
Internal v3.407.0 adds logical edit views and transaction-bound cursors for InsertContentEvent and RemoveContentEvent; use fresh cursors after structural mutations, and keep original parser coordinates only as an expiring source snapshot
Internal v3.406.0 adds SetContentEventTag, SetContentEventParam and RemoveContentEventParam for source-only declarations and points; all require an active preserving transaction
Use BeginPageObjectEditTransaction(False, True) to request source-event preservation for a batch of typed object edits, then commit once
Internal v3.405.0 extends preserving regeneration from text to paths, named image XObjects and Form invocation geometry; empty/gapped stream declarations, points and exact membership survive supported edits and removal, and supported canonical output can be reopened and edited again
Dirty untagged Form subtrees are given private streams and resource namespaces per invocation, including nested edits and removal; unchanged invocations keep their original streams, dictionaries and resources
Form Matrix and BBox entries keep their meaning; changing a Form invocation's inherited graphics after parsing is rejected because its cached children would otherwise work from stale state
Insertion, changed declaration membership, inline images, source clipping, non-Normal blend states, default RGB/Gray overrides, unknown graphics-state keys and lossy native operands sit outside that writer profile; a Form's unchanged implicit BBox clip is supported
Dirty Forms with StructParents or documents with StructTreeRoot are rejected until reciprocal structure updates are supported; unchanged tagged Form streams can remain opaque
The writer accepts at most 4096 original content-stream slots; a readable inventory on its own does not certify that the current source/edit combination can be regenerated
Recursive preflight caps depth at 64 and the represented tree at 1048576 objects and 1048576 events; it completes before any stream or namespace mutation
A rejected preserving commit restores the transaction snapshot and raises EPdfError; it never falls back to ordinary generation
Marked-content preservation does not establish tagged ParentTree reciprocity or PDF/A/PDF/UA conformance
ContentEventCount, BeginPageObjectEditTransaction, CommitPageObjectEditTransaction