PDFium Delphi Component Docs

SelectWordSpan 方法

元件: TPdfView  ·  單元: PDFium
把同一頁面上的一段 TPdfWordBox 記錄選取為一個 TPdfView 文字選取

語法

function SelectWordSpan(const Words: TPdfWordBoxes; StartIndex, EndIndex: Integer): Boolean;

參數

WordsTPdfWordBoxes
StartIndexInteger
EndIndexInteger

傳回值

Boolean

說明

SelectWordSpan 會夾限請求的字詞索引,要求兩個端點位於同一頁面,接著選取合併後的字元範圍

當目前朗讀的字詞或短語需要真正的檢視器文字選取時,可搭配 PageWordBoxes 使用

備註

範例

var Words: TPdfWordBoxes;
begin
  Words := PdfView1.PageWordBoxes;
  PdfView1.SelectWordSpan(Words, 0, 4);
end;

另請參閱

PageWordBoxes, SelectWordBox, SelectTextRange, WordBoxIndexAtCharIndex