function WordBoxIndexAtCharIndex(const Words: TPdfWordBoxes; CharIndex: Integer): Integer;
| Words | TPdfWordBoxes |
| CharIndex | Integer |
IntegerWordBoxIndexAtCharIndex 返回其 StartIndex 和 Count 包含所请求字符索引的从 0 开始的词框索引,或在没有词匹配时返回 -1
使用结果来选择在 TTS 游标前进时应高亮或选择哪个 TPdfWordBox
CharIndex 超出每个词范围时返回 -1Index := WordBoxIndexAtCharIndex(Words, PdfView1.CurrentCharIndex);
if Index >= 0 then
PdfView1.SelectWordBox(Words[Index]);