AddLinkToFile
Annotations and hotspot links
Description
Adds a clickable hotspot rectangle to the selected page which links to a specific page and position in another PDF document.
Use SetAnnotBorderColor to change the hotspot border color after the annotation is created.
Syntax
Delphi
Function TPDFlib.AddLinkToFile(Left, Top, Width, Height: Double; Const FileName: WideString; Page: Integer; Position: Double; NewWindow, Options: Integer): Integer;Parameters
| Left | The horizontal coordinate of the left edge of the hotspot rectangle. |
|---|---|
| Top | The vertical coordinate of the top edge of the hotspot rectangle. |
| Width | The width of the hotspot rectangle. |
| Height | The height of the hotspot rectangle. |
| FileName | The path and file name of the PDF document to link to. |
| Page | The one-based page number in the destination document. |
| Position | The vertical position on the destination page to open. |
| NewWindow | 0 closes the current document before opening the target document; 1 opens the target in a new window. |
| Options | Specifies the link appearance: 0 = no border, 1 = draw a border. |
Return values
| 0 | The link could not be created, usually because the destination page number is invalid. |
|---|---|
| 1 | The link annotation was created successfully. |