PDFium Delphi Component Docs

WordBoxIndexAtCharIndex Fonction

Module: PDFium
Associe un indice de caractère FTextPage au TPdfWordBox qui le contient

Syntaxe

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

Paramètres

WordsTPdfWordBoxes
CharIndexInteger

Valeur de retour

Integer

Description

WordBoxIndexAtCharIndex renvoie l’indice de boîte de mot de base zéro dont StartIndex et Count contiennent l’indice de caractère demandé, ou -1 si aucun mot ne correspond

Utilisez le résultat pour choisir quel TPdfWordBox doit être surligné ou sélectionné à mesure qu’un curseur TTS avance

Remarques

Exemple

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

Voir aussi

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