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