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

LeftThe horizontal coordinate of the left edge of the hotspot rectangle.
TopThe vertical coordinate of the top edge of the hotspot rectangle.
WidthThe width of the hotspot rectangle.
HeightThe height of the hotspot rectangle.
FileNameThe path and file name of the PDF document to link to.
PageThe one-based page number in the destination document.
PositionThe vertical position on the destination page to open.
NewWindow0 closes the current document before opening the target document; 1 opens the target in a new window.
OptionsSpecifies the link appearance: 0 = no border, 1 = draw a border.

Return values

0The link could not be created, usually because the destination page number is invalid.
1The link annotation was created successfully.