THPDFPage.AddGoToRStructureDestinationLink Method
Adds a link annotation whose GoToR action targets a structure element in an external PDF by the byte-string /ID of that element, while keeping the required /D fallback page destination in the remote file
Declaration
procedure AddGoToRStructureDestinationLink(Rectangle: TRect; const FileName: AnsiString;
const RemoteStructElemID: AnsiString; FallbackTargetPageIndex: Integer= 0;
YPos: Single= - 1; NewWindow: boolean= false; const Description: AnsiString= '');
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
Rectangle | Hot-spot rectangle in page units where the link is active |
FileName | Non-empty path to the external PDF; backslashes are normalized to forward slashes |
RemoteStructElemID | Non-empty byte-string /ID of the target StructElem in FileName; must match the /ID stamped on that element via the IDStr overload of AddStructureElement |
FallbackTargetPageIndex | Required zero-based page index in the remote file used by the /D fallback destination; must be >= 0 |
YPos | Optional vertical position for the /XYZ fit; pass a negative value to leave it null |
NewWindow | When true, emits /NewWindow true so the viewer opens the target in a new window |
Description | Alternate description stored in the annotation /Contents; required under PDFUACompliance |
Return value
This member does not return a value
Behavior
- Requires PDF 2.0 (ISO 32000-2) and follows
StrictVersionLockbehavior - Remote structure targets cannot reference a foreign StructElem by pointer, so ISO 32000-2 ยง12.3.2.3 requires the first
/SDelement to be the byte-string/IDof the target element; the emitted literal-string form matches the/IDformAddStructureElementproduces for the sameIDStr - Emits a GoToR action with
/F, a required/Dfallback destination, and the/SDbyte-string array - An empty
FileName, emptyRemoteStructElemID, or negativeFallbackTargetPageIndexraises before any annotation or version bump is emitted