GetOutlineDestinationInfo
Outlines, annotations and hotspot links
Description
Returns the destination of an outline item as a TPDFlibDestinationInfo, resolving it whether it hangs directly off /Dest or inside a GoTo action, and filling in the target page and the XYZ/Fit parameters. An item with no destination, or with one that does not resolve to a known fit type, reports Kind = dkNone and page 0.
Syntax
Delphi
Function TPDFlib.GetOutlineDestinationInfo(OutlineID: Integer): TPDFlibDestinationInfo;
Parameters
OutlineID is an outline handle from NewOutline, GetFirstOutline, GetNextOutline or GetFirstChildOutline; an unknown or stale handle yields an unresolved record. The destination is taken from the item's /Dest entry when present and otherwise from the /D entry of its action.
Return values
A TPDFlibDestinationInfo whose Kind is the fit type — dkXYZ, dkFit, dkFitH, dkFitV, dkFitR, dkFitB, dkFitBH or dkFitBV — with Page as a 1-based page number and only the coordinates that fit type defines filled in. Kind is dkNone and Page is 0 when the item has no destination, the destination is a named destination, the fit name is unrecognised, or the handle is stale.
Remarks
Coordinates are converted to the current measurement unit and flipped for the current origin, exactly as the GetDestValue family reports them, and Zoom is a percentage where 100 means 100 per cent. dkFitR fills the rectangle as Left, Bottom, Right and Top in PDF array order; fit types without a coordinate leave it at 0, so branch on Kind before using the numbers. A named destination — a name or string in /Dest resolved through the document's name tree — is not followed and reports dkNone. The action behind /D is read without checking its type, so a GoToR bookmark produces fit and page values that refer to the remote file.