PDFium Delphi Component Docs

WordBoxIndexAtCharIndex 함수

유닛: PDFium
FTextPage 문자 인덱스를 그 문자를 포함하는 TPdfWordBox에 매핑합니다

구문

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

매개변수

WordsTPdfWordBoxes
CharIndexInteger

반환 값

Integer

설명

WordBoxIndexAtCharIndex는 StartIndex와 Count가 요청한 문자 인덱스를 포함하는 0 기반 워드 박스 인덱스를 반환하며, 맞는 단어가 없으면 -1을 반환합니다

TTS 커서가 진행될 때 어느 TPdfWordBox를 하이라이트하거나 선택할지 고르는 데 결과를 사용하세요

참고 사항

예제

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

관련 항목

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