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

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.