PDFium Delphi Component Docs

TPdfReadingUnit record

Unit: PDFium
Stores one spoken reading unit with text, semantic kind, page, highlight rectangles, source indexes, alternate-text state, and language

Syntax

type TPdfReadingUnit = record ... end;

Fields

FieldTypePurpose
TextWStringText to speak
KindTPdfContentFragmentKindSource TPdfContentFragmentKind
HeadingLevelIntegerHeading level 1..6 for headings, otherwise 0
PageIntegerOne-based page number
RectsTPdfRectanglesHighlight rectangles in page coordinates
FragmentIndexIntegerSource fragment index
SentenceIndexIntegerSentence index inside the fragment
IsAlternateTextBooleanTrue when Text came from Alt or ActualText
LanguageWStringLanguage tag for voice selection

Description

Reading units keep headings and figure alternate text whole, split paragraph text at sentence boundaries, preserve decimal points, and leave the reading cursor as a caller-owned array index

Use Rects with TPdfView.SetReadingHighlight and Language to coordinate visual highlighting with a TTS voice

Remarks

See Also

ReadableContent, SetReadingHighlight