PDFium Delphi Component Docs

LinkAnnotation 属性

组件: TPdf  ·  单元: PDFium
索引属性 — 返回给定索引处显式 /Annot Subtype Link,包括目标动作或目标位置

语法

property LinkAnnotation[PageNumber, Index: Integer]: TLinkAnnotation; // read only

说明

索引只读属性,返回给定索引处显式 /Annot Subtype Link,包括目标动作或目标位置

要求 Active 为 True。PageNumber 从 1 开始(1 .. PageCount),Index 位于 0 .. LinkAnnotationCount[PageNumber] - 1 范围内

返回的记录是调用时值的快照;之后对文档的编辑不会修改先前返回的记录

读取其他页面不会改动 PageNumber:该页只为本次调用而打开,页面动作不会执行,当前页的状态保持不变。对这类页面,记录里的 Handle 为 nil,因为原生链接句柄不会活过那个临时页面

参数

PageNumber从 1 开始的页码(1 .. PageCount)
Index从 0 开始的链接索引,范围为 0 .. LinkAnnotationCount[PageNumber] - 1

备注

示例

var
  I: Integer;
begin
  if not Pdf1.Active then Exit;
  for I := 0 to Pdf1.LinkAnnotationCount[1] - 1 do
  begin
    // inspect Pdf1.LinkAnnotation[1, I]
    Memo1.Lines.Add(IntToStr(I));
  end;
end;

ActionPath 返回从 UTF-8 解码的 URI 动作目标;原生缓冲区包含所需结束符,返回字符串则不包含它

另请参阅

LinkAnnotationCount, WebLink, Annotation