PDFium Delphi Component Docs

LinkAnnotation property

Component: TPdf  ·  Unit: PDFium
Indexed property — returns the explicit /Annot Subtype Link at the given index, including the target action or destination

Syntax

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

Description

Indexed read-only property that returns the explicit /Annot Subtype Link at the given index, including the target action or destination

Needs Active to be True. PageNumber is 1-based (1 .. PageCount) and Index runs 0 .. LinkAnnotationCount[PageNumber] - 1

The returned record is a snapshot of the value at the time of the call; subsequent edits to the document do not modify previously returned records

Reading another page does not change PageNumber: the page is opened only for the call, so its page actions do not run and the current page keeps its state. For such a page the record's Handle is nil, because the native link handle does not outlive that temporary page

Parameters

PageNumberOne-based page number (1 .. PageCount)
IndexZero-based link index in 0 .. LinkAnnotationCount[PageNumber] - 1

Remarks

Example

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 supplies UTF-8-decoded URI action targets; the required terminator is included in the native buffer but omitted from the returned string

See Also

LinkAnnotationCount, WebLink, Annotation