type TPdfReadingUnit = record ... end;
| Field | Type | Purpose |
|---|---|---|
Text | WString | 要朗讀的文字 |
Kind | TPdfContentFragmentKind | 來源 TPdfContentFragmentKind |
HeadingLevel | Integer | 標題的層級 1..6,非標題時為 0 |
Page | Integer | 以 1 為基底的頁碼 |
Rects | TPdfRectangles | 頁面座標中的高亮矩形 |
FragmentIndex | Integer | 來源片段索引 |
SentenceIndex | Integer | 片段內的句子索引 |
IsAlternateText | Boolean | Text 來自 Alt 或 ActualText 時為 True |
Language | WString | 用於語音選擇的語言標籤 |
朗讀單元會把標題與圖片替代文字保持完整、在句子邊界切分段落文字、保留小數點,並讓朗讀游標保持為呼叫端擁有的陣列索引
將 Rects 搭配 TPdfView.SetReadingHighlight、Language 搭配 TTS 語音使用,即可讓視覺高亮與語音協調一致