PDFium Delphi Component Docs

TPdfSpokenSpan record

Unit: PDFium
Stores one mapped run of speech text and the page text range it came from

Syntax

ContextOnly: Boolean; // synthesized announcement with no native source

type TPdfSpokenSpan = record ... end;

Fields

FieldTypePurpose
SpokenStartIntegerZero-based character offset inside TPdfSpokenText.Text
SpokenCountIntegerCharacter count in the spoken text covered by this span
PageIntegerOne-based source page number
StartIndexIntegerZero-based FTextPage character index of the source range
CountIntegerSource character count mapped to this span

Description

A span links a run in the speech-engine string back to the page text so read-aloud code can highlight or select the original PDF characters

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

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 the existing exact top-level object/MCID profile and its character/object/work limits

Remarks

See Also

TPdfSpokenText, SpokenTextAppend, SpokenToPageChar