AddLinkToPage
Annotations and hotspot links, Page properties
Description
Adds a clickable hotspot rectangle to the selected page which links to another page in the same document.
Use the SetAnnotBorderColor function to change the color of the hotspot border.
For a top-based origin, the destination position is converted using the target page height; the clickable rectangle continues to use the source page coordinates, including when the pages have different sizes
Syntax
Delphi
Function TPDFlib.AddLinkToPage(Left, Top, Width, Height: Double; Page: Integer; Position: Double; Options: Integer): Integer;
ActiveX
Function PDFlib::AddLinkToPage(Left As Double, Top As Double, Width As Double, Height As Double, Page As Long, Position As Double, Options As Long) As Long
DLL
int DLAddLinkToPage(int InstanceID, double Left, double Top, double Width, double Height, int Page, double Position, int Options);
Parameters
| Left | The left edge of the hotspot rectangle. With a font selected and center or right text alignment active, it is the center or the right edge instead, as for DrawText |
|---|---|
| Top | The top edge of the hotspot rectangle. With a font selected, unless drawing to a canvas DC, the rectangle is placed below this value by the font-top offset of that font, the current text rise included, so a link over a line of text takes the same Top as the text |
| Width | The width of the hotspot rectangle |
| Height | The height of the hotspot rectangle |
| Page | The destination page number to link to |
| Position | The vertical position on the destination page to link to |
| Options | Specifies the appearance of the link: 0 = No border 1 = Draw a border |
Return values
Returns 1 when the link has been added, and 0 when it was not, in which case nothing is written to the page: no page is selected, Width or Height is zero or negative, or Page is not a page of the document.