TPdfReadableSemanticSource = (rssNone, rssActualText, rssAlternateText, rssExpansion, rssAlternatives); TPdfContentFragment = record Kind: TPdfContentFragmentKind; TypeName, Text, Language: WString; HeadingLevel, Page, StructElementIndex: Integer; IsAlternateText: Boolean; BoundingRect: TPdfRectangle; LineRects: TPdfRectangles; Source: TPdfReadingOrderSource; MarkedContentIDs: TPdfIntegerArray; TableContext: TPdfReaderTableContext; ListContext: TPdfReaderListContext; SourceParts: TPdfReadableSourceParts; NativeObjectPath: TPdfIntegerArray; FormSourceIdentity: string; SemanticSource: TPdfReadableSemanticSource; SemanticParts: TPdfReadableSemanticParts; LogicalOrderIndex: Integer; SemanticScopes: TPdfReadableSemanticScopes; SemanticMetadataOnly: Boolean; end;
Since v3.251.0, SemanticSource is rssNone, rssActualText, rssAlternateText or rssExpansion. A certified replacement also has IsAlternateText=True; its text is available for validated semantic speech while exact native character selection remains unavailable. See IncludeSemanticReplacements
Since v3.276.0, a same-page semantic fragment can cover several MCRs in distinct page/Form namespaces, with complete native text and nontext bounds in LineRects and the semantic owner's own role/language. MarkedContentIDs follows logical member order and can repeat a numeric ID from different namespaces; NativeObjectPath identifies only the first native source, while FormSourceIdentity certifies the current complete owner. These fields do not provide a replacement-to-glyph map
Since v3.277.0, complete structure replacements can span several pages. Page is the first source page in logical order, and BoundingRect/LineRects contain only that anchor page's sources; coordinates from different pages are never combined into one rectangle. SemanticParts retains every native source in logical member order, including foreign-page text, paths and images
TPdfReadableSemanticPartKind = (spkPageObject, spkEmptyMarkedContent, spkEmptyFormInvocation); TPdfReadableSemanticPart = record Kind: TPdfReadableSemanticPartKind; Page, MarkedContentID: Integer; BoundingRect: TPdfRectangle; NativeObjectPath: TPdfIntegerArray; FormSourceIdentity: string; end; TPdfReadableSemanticParts = array of TPdfReadableSemanticPart;
Each page-object part records the effective inherited MCID, source page, transformed native bounds, instance-specific path and current source identity; its MCID can belong to the page or an enclosing Form namespace. These are handle-free provenance records, not text slices or character maps. SourceParts separately describes exact source text for paragraph continuation. Cached results and reading units own independent SemanticParts arrays and nested paths
Since v3.282.0, Kind distinguishes actual page-object provenance from a certified nonpainting marked-content sequence. spkEmptyMarkedContent has a sequence-specific identity and effective MCR, an empty NativeObjectPath and zero BoundingRect because it has no painted geometry. Only spkPageObject sources contribute LineRects and bounds; an owner containing only empty sequences has no line rectangles or glyph selection. Empty sequence occurrences retain their position before, between or after actual source objects
Since v3.285.0, spkEmptyFormInvocation retains a real childless Form call with its actual invocation path, zero painted geometry and no invented character mapping. Marked declarations around Do calls propagate through complete nested descendants, preserving native hierarchy, language and per-invocation identities. Painted descendants retain their full transformed bounds; empty invocations do not contribute LineRects or geometric margin tests
Since v3.286.0, explicit zero-paint MCID ranges without semantic properties also retain spkEmptyMarkedContent provenance. These are independent sequence boundaries in their real page/Form namespaces, including inherited Form scopes and complete structure owners. No semantic scope is fabricated for the range itself; only genuine declarations reference it. Empty membership outside a replacement is consumed without publishing an invented glyph
LogicalOrderIndex is a one-based position in the certified current document MCR order, shared by fragments from the same logical item; zero means that this ordering certificate is unavailable. It is runtime metadata and does not replace StructElementIndex or identify a durable PDF object. DocumentReadableContent uses complete certified indexes for stable global ordering, with semantic owners emitted once on their anchor page
Since v3.278.0, SemanticScopes retains simultaneous and nested structure ActualText/Alt/E declarations, with their own roles, inherited languages and semantic-parent identities. SourcePartIndices refers to the fragment's SemanticParts array and describes complete descendant coverage; a declared empty child can have no physical sources. This is a semantic-declaration hierarchy, not a copy of every structure element
TPdfReadableSemanticScopeOrigin = (rsoStructure, rsoMarkedContent); TPdfReadableSemanticScope = record Origin: TPdfReadableSemanticScopeOrigin; Identity, ParentIdentity: string; TypeName, Language: WString; HasActualText, HasAlternateText, HasExpansion: Boolean; ActualText, AlternateText, Expansion: WString; SourcePartIndices: TPdfIntegerArray; end; TPdfReadableSemanticScopes = array of TPdfReadableSemanticScope;
Since v3.279.0, Origin distinguishes structure declarations from native marked-content declarations. Within a complete structure replacement, native scopes retain nested and simultaneous ActualText/Alt/E, partial or multi-MCID coverage and separate occurrences of a reused property dictionary. Native semantic parents retain native nesting; an outer native scope attaches to the deepest containing structure declaration. SourcePartIndices can describe crossing coverage with other structure declarations without pretending those scopes form one universal tree
Different ActualText on proper subsets remains available independently. When native and structure ActualText declarations have identical source coverage, the native value must agree with a coextensive structure declaration. Identities contain no borrowed native handles
Since v3.280.0, native graphs also work outside structure replacements when every source has certified MCR ownership. A standalone root can cover only part of an MCID or several MCIDs; it emits once with complete SemanticParts, while uncovered glyphs retain exact independent selection and speech. Its root has an empty ParentIdentity, and the native tag supplies TypeName and the preferred primary. Missing native language uses a common structure language or the document language when contexts disagree
Since v3.281.0, a native scope can connect independent structure replacements and partial ordinary MCR sources into one complete component, including transitive foreign-page membership. Such a fragment has SemanticSource=rssAlternatives, SemanticMetadataOnly=True, Text='', TypeName='SemanticGroup' and Kind=cfPlain. Its scopes retain the original declaration forest, without inventing a common semantic parent or selecting one independent declaration as the whole component's primary
The component emits once on its first logical source page, retains complete source-specific SemanticParts and anchor-page bounds, and uses document language as its group label while each declaration keeps its own language. Filtering any source or declared Artifact scope suppresses the whole component. BuildReadingUnits omits the group; explicitly choose a nonempty declaration through BuildSpokenSemanticScope. Sources outside the component remain independent, including uncovered glyphs within an ordinary MCR
Each fragment accepts at most 4096 semantic scopes, matching explicit speech validation. Since v3.282.0, certified nonpainting declarations participate in standalone, structure-owned and connected scope graphs, including nested empty declarations and reused named properties. Since v3.283.0, IncludeUnownedSemanticContent admits native sources outside certified MCR ownership, using Source=rosContent and LogicalOrderIndex=0. Sources retain their actual effective MCID, including -1 for unmarked semantic parts; unmarked glyphs have no MarkedContentIDs. Content-order sources and mixed components follow page/native source order without claiming a logical structure order. Unmatched serialized/native paint inventories, preservation during existing source-stream rewriting remain separate work
Presence flags distinguish an absent property from an explicitly empty string. Default flat presentation uses the outermost complete owner's ActualText, then Alt, then E, while retaining the other declarations. This is an explicit presentation policy; nested descriptions are not discarded or automatically duplicated in flat output
If the selected primary is empty but another declaration is nonempty, SemanticMetadataOnly=True preserves the fragment and its alternatives, while BuildReadingUnits omits its empty primary. Use BuildSpokenSemanticScope to validate and explicitly speak a chosen declaration as unmapped context. An excluded source or Artifact scope omits the complete fragment, including its alternatives
Reader fragments and reading units carry TableContext for tagged TH/TD cells and their paragraph descendants, including page-local table/cell identities, zero-based row/column slots, RowSpan and ColumnSpan
Since v3.284.0, TryComposeReadableText and BuildSpokenReadableText provide explicit character/word substitution composition without replacing the per-fragment reading-unit contract. Composed speech validates complete contiguous current sources, keeps exact glyph mappings and leaves semantic replacements and inserted spaces unmapped
Explicit Headers IDs take precedence; otherwise Column/Row/Both scope and preceding overlapping grid positions determine header associations, with positional inference when Scope is absent
Header labels come from retained readable fragments, so filtered Artifact headers cannot leak into spoken metadata; nested paragraph cells inherit the owning cell's context
HeadersExplicit distinguishes declared ID associations from inferred scopes; HeadersComplete and ErrorMessage report missing, duplicate, cyclic, filtered or over-budget headers and unsupported grids
Tagged identities are structure-element indexes in the current page snapshot; geometric identities are indexes in the supplied TPdfTables/Cells arrays and Source distinguishes those domains
BuildSpokenReadingUnit optionally prefixes data text with associated header labels; synthetic announcements have ContextOnly=True spans and SpokenToPageChar returns False inside them, while body offsets map to exact native characters
The speech builder validates source text and current tagged header contexts, preserves selection/page state and leaves its var output unchanged on rejection; IncludeContext=False permits validated body-only speech when semantic context is incomplete
Cached fragments, returned fragments, reading units and source snapshots own separate header arrays; mutating one does not alter the others
Tagged enrichment permits 16384 elements, 4096 cells, 1024 columns, row indexes/spans below or up to 4096, depth-64 header references, 128 headers per cell, 1048576 UTF-16 units each for labels/expanded associations and 8388608 work visits
Unsupported metadata leaves source text intact with diagnostics; native speech mapping uses exact top-level object/MCID ownership or the opt-in nested Form profile, with shared invocations enabled separately, with the declared character/object/work limits
Reader fragments and reading units carry ListContext from their nearest LI/L structure owners, including one-based nesting depth, page-local item position, numbering, explicit label text and an outer-to-inner ancestor path
Lbl descendants are identified by IsLabel and retain their actual label text; paragraph descendants under LBody inherit the owning item context without borrowing labels from neighboring or nested lists
Retained explicit labels take precedence over generated labels and support arbitrary Unicode and numbering styles
For complete lists without conflicting labels, generation supports Decimal, Roman numerals through 3999, English/unspecified Latin alphabetic numbering through 4096, Disc, Circle, Square, None and Unordered
UpperAlpha/LowerAlpha in other languages, generic Ordered/Description styles without labels, partial native list snapshots and inconsistent mixed labels require explicit Lbl content instead of guessed numbering
Filtered labels are not regenerated from ListNumbering; incomplete ancestor labels propagate a diagnostic to descendant paths while preserving all retained body text
BuildSpokenReadingUnit prefixes body speech with the outer-to-inner label path, marks it ContextOnly and validates the current tagged path before constructing exact native body mappings; label units are not prefixed with their own path
IncludeContext=False provides body-only speech when source mapping is valid; incomplete or stale context rejects without changing the caller's speech output
List metadata permits 16384 elements, 4096 items, depth 64 and separate 1048576-UTF-16-unit budgets for labels, expanded paths and attached paths; returned/cache/unit/source arrays remain independently owned
Native tree parsing may omit overly deep structures before these wrapper limits; a heuristic Source with unavailable ListContext signals that semantic labels were not established
Numbering names follow ISO 32000-1 list attributes; this profile does not infer arbitrary visual lists or language-specific alphabets without explicit labels
TPdf.ParagraphContinuation is disabled by default and affects DocumentReadableContent and DocumentReadingUnits only; page-readable snapshots remain unchanged and reusable
When enabled, the last ordinary paragraph/plain fragment of one page may join the first on the next page if both lie in the configured unrotated CropBox edge bands, align horizontally, use compatible line heights, share language and lack table/list context
A terminal sentence boundary, uppercase/noncontinuing start, heading, table, list, blank page, geometry/language mismatch or exhausted budget keeps the original fragments separate
EdgeBand defaults to 72 points, AlignmentTolerance to 18, MaxParts to 16 and MaxJoinedTextUnits to 262144; numeric settings are validated before assignment and part limits accept 1..64
Adjacent CJK parts remain unspaced; retained end-of-line hyphens join without an artificial space and optional Dehyphenate removes the boundary hyphen from reader text only
Every joined fragment has SourceParts containing each original page, complete source text, source UTF-16 slice, combined-text offset, MCIDs and original page-space geometry
Fragment/reading-unit Page and primary geometry identify the first source page; other pages remain available in SourceParts, and selection/speech helpers resolve their actual native positions without navigating the viewer
SelectFragment, SelectReadingUnit and BuildSpokenReadingUnit validate every selected source slice and can select/map a sentence spanning multiple pages or a later sentence on only one source page
Inserted join spaces are ContextOnly spans with no native character; source text, source ranges and part arrays remain independent snapshots and rejection preserves selection or caller speech output
Joining permits up to 1048576 total raw source UTF-16 units and 4096 MCIDs/rectangles per part; exact mapping shares the 4194304 native-character visit budget across selected parts
This is conservative paragraph continuation, not universal paragraph recognition; it does not mutate saved PDFs, remove physical hyphens or automatically change the visible page
Opt-in IncludeFormXObjects expands unique untagged nested Forms with page-space geometry and native selection/speech ownership; NativeObjectPath and FormSourceIdentity are independently copied into fragments, reading units and continuation source parts
NestedFormsComplete=False and NestedFormsError report disabled shared/tagged, clipped, unsupported or over-budget paths; unrelated top-level output and supported siblings remain available
Set IncludeSharedFormXObjects together with IncludeFormXObjects to read each untagged shared invocation separately, including identical overlapping text; source identities bind the live invocation and full object path
Separate opt-in IncludeTaggedFormXObjects reads the bounded tagged Form profile in certified structure order, with explicit page/Form MCID namespaces and ParentTree ownership; same-page shared invocations also require IncludeSharedFormXObjects, and certified fragments carry independent live paths/identities and StructElementIndex=-1