function WordBoxIndexAtCharIndex(const Words: TPdfWordBoxes; CharIndex: Integer): Integer;
| Words | TPdfWordBoxes |
| CharIndex | Integer |
IntegerWordBoxIndexAtCharIndex 傳回以 0 為基底的字詞方塊索引,其 StartIndex 與 Count 涵蓋請求的字元索引;若沒有符合的字詞則傳回 -1
當 TTS 游標前進時,可利用此結果選擇要反白或選取哪個 TPdfWordBox
CharIndex 超出所有字詞範圍時傳回 -1Index := WordBoxIndexAtCharIndex(Words, PdfView1.CurrentCharIndex);
if Index >= 0 then
PdfView1.SelectWordBox(Words[Index]);