PDFium Component Docs

WordBoxIndexAtCharIndex function

Unit: PDFium
Memetakan indeks karakter FTextPage ke TPdfWordBox yang memuatnya

Syntax

function WordBoxIndexAtCharIndex(const Words: TPdfWordBoxes; CharIndex: Integer): Integer;

Parameters

WordsTPdfWordBoxes
CharIndexInteger

Return Value

Integer

Description

WordBoxIndexAtCharIndex mengembalikan indeks word-box berbasis nol yang StartIndex dan Count-nya memuat indeks karakter yang diminta, atau -1 ketika tidak ada kata yang cocok

Gunakan hasilnya untuk memilih TPdfWordBox mana yang harus disorot atau dipilih saat kursor TTS maju

Remarks

Example

Index := WordBoxIndexAtCharIndex(Words, PdfView1.CurrentCharIndex);
if Index >= 0 then
  PdfView1.SelectWordBox(Words[Index]);

See Also

BuildWordBoxes, TPdfView.PageWordBoxes, TPdfView.SelectWordBox, TPdfView.SetReadingHighlight