TPDFlibSearchHit

数据类型

描述

TPDFlibSearchHit 是一个记录结构,表示在页面文本搜索期间找到的查询结果,存储匹配坐标、匹配项在周围块文本中的位置,以及当 SearchContextChars 为正数时匹配项紧邻前后的文本

语法

Delphi

type TPDFlibSearchHit = record
    Page: Integer;
    Left: Double;
    Top: Double;
    Right: Double;
    Bottom: Double;
    MatchText: WideString;
    MatchStart: Integer;
    MatchLength: Integer;
    ContextBefore: WideString;
    ContextAfter: WideString;
  end;

字段

Page找到搜索文本匹配项的从 1 开始页码
Left命中边界框的水平左坐标
Top命中边界框的垂直上坐标
Right命中边界框的水平右坐标
Bottom命中边界框的垂直下坐标
MatchText与搜索查询匹配的周围页面文本行
MatchStart匹配项在 MatchText 内从 1 开始的索引
MatchLength匹配片段在 MatchText 内的长度
ContextBefore匹配项紧前方最多 SearchContextChars 个字符;除非 SearchContextChars 为正数,否则为空
ContextAfter匹配项紧后方最多 SearchContextChars 个字符;除非 SearchContextChars 为正数,否则为空

另请参阅

SearchText、SearchContextChars、AddTextMarkupFromSearchHits