GetAnnotActionInfo

Annotations and hotspot links

Description

Returns the action attached to an annotation on the selected page as a TPDFlibActionInfo record describing its kind and target, with Kind left at akNone when the annotation carries no action. The record always refers to the page that is selected when the call is made.

Syntax

Delphi

Function TPDFlib.GetAnnotActionInfo(Index: Integer): TPDFlibActionInfo;

Parameters

Index is the 1-based position of the annotation in the selected page's /Annots array — the same index taken by GetAnnotActionID and bounded by AnnotationCount. A value below 1 or above the annotation count resolves to no action instead of raising an exception.

Return values

A TPDFlibActionInfo describing the annotation's /A action, with Kind set to the decoded action type and the type-specific members filled in. Kind stays akNone, with every other member at its default, when the annotation carries no action, the index is out of range, or the action's /S names a type the library does not decode.

Remarks

Annotations belong to the selected page, so call SelectPage first: the same index means a different annotation on another page. The action may be an inline dictionary or an indirect reference, and both are followed. The defaults are meaningful in their own right: RemotePage is -1 when a remote destination names no page, RemoteDestinationType is 0 for an unrecognised fit name, RemoteZoom is a percentage where 100 means 100 per cent, HideAnnotations defaults to True, and LaunchOperation defaults to open.