AddLinkToFileA
Annotations and hotspot links
Description
The trailing A denotes the ANSI (char) DLL entry point; the ActiveX/COM surface exposes only the Unicode form. Behaviour is identical to AddLinkToFile and string arguments are interpreted using the current SetAnsiMode code page
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 colour after the annotation is created.
Syntax
Delphi
Function DLAddLinkToFileA(InstanceID: Integer; Left, Top, Width, Height: Double; FileName: PAnsiChar; Page: Integer; Position: Double; NewWindow, Options: Integer): Integer;
DLL
int DLAddLinkToFileA(int InstanceID, double Left, double Top, double Width, double Height, const char* FileName, int Page, double Position, int NewWindow, int Options);
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. |