PDFium Delphi Component Docs

CurrentCharIndex 属性

组件: TPdfView  ·  单元: PDFium
为兼容性保留的应用程序选定从零开始的字符索引(默认 0)

语法

property CurrentCharIndex: Integer; // default 0

说明

读取或写入查看器上由应用程序管理的字符索引(默认 0)。赋值只保存这个整数,不会触发重绘,也不改动当前文本选择

要在运行时命中测试鼠标光标下的字符,请调用 PdfView1.CharacterIndexAtPos,或先用 DeviceToPage 转换客户区坐标,再查询 Pdf.CharacterIndexAtPos

备注

示例

begin
  Memo1.Lines.Add(IntToStr(PdfView1.CurrentCharIndex));
  PdfView1.Active := True;
  Memo1.Lines.Add(IntToStr(PdfView1.CurrentCharIndex));
end;

参见

Active, Pdf, Options, Zoom