AddRelativeLinkToFile

Annotations and hotspot links

Description

Adds a clickable hotspot rectangle to the selected page which links using relative path to a specific page and position in another PDF document.

Use the SetAnnotBorderColor function to change the color of the hotspot border.

Relative file targets are computed from directory components, so a target in the same directory does not acquire parent-directory prefixes; a target on another drive or root retains an absolute file specification

Syntax

Delphi

Function TPDFlib.AddRelativeLinkToFile(Left, Top, Width, Height: Double; Const FileName: WideString; Page: Integer; Position: Double; NewWindow, Options: Integer): Integer;

ActiveX

Function PDFlib::AddRelativeLinkToFile(Left As Double, Top As Double, Width As Double, Height As Double, FileName As String, Page As Long, Position As Double, NewWindow As Long, Options As Long) As Long

DLL

int DLAddRelativeLinkToFile(int InstanceID, double Left, double Top, double Width, double Height, const wchar_t* FileName, int Page, double Position, int NewWindow, int Options);
int DLAddRelativeLinkToFileA(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 co-ordinate of the left edge of the hotspot rectangle

Top

The vertical co-ordinate of the top edge of the hotspot rectangle

Width

The width of the hotspot rectangle

Height

The height of the hotspot rectangle

FileName

The full absolute path and file name of the PDF document to link to, it will be converted to relative path.

Page

The page in the destination document to link to

Position

The vertical co-ordinate on the destination page to link to

NewWindow

0 = Close the current document and then open the new document

1 = Open the current document in a new window

Options

Specifies the appearance of the link:

0 = No border

1 = Draw a border

Return values

Returns 1 when the link has been added. Returns 0 when Page is not greater than 0.