AddLinkToJavaScript

JavaScript, Annotations and hotspot links

Description

Adds a clickable hotspot rectangle to the selected page which links to a JavaScript action

Use the SetAnnotBorderColor function to change the colour of the hotspot border

The function is rejected in PDF/A and PDF/X-1a, PDF/X-3 or PDF/X-4 modes, but PDF/X-6 modes permit this directly activated Link action; document, page and form-field JavaScript remains forbidden in PDF/X-6

Syntax

Delphi

Function TPDFlib.AddLinkToJavaScript(Left, Top, Width, Height: Double; Const JavaScript: WideString; Options: Integer): Integer;

ActiveX

Function PDFlib::AddLinkToJavaScript(Left As Double, Top As Double, Width As Double, Height As Double, JavaScript As String, Options As Long) As Long

DLL

int DLAddLinkToJavaScript(int InstanceID, double Left, double Top, double Width, double Height, const wchar_t * JavaScript, int Options);

Parameters

LeftThe horizontal co-ordinate of the left edge of the hotspot rectangle
TopThe vertical co-ordinate of the top edge of the hotspot rectangle
WidthThe width of the hotspot rectangle
HeightThe height of the hotspot rectangle
JavaScriptThe JavaScript to execute
OptionsSpecifies the appearance of the link: 0 = No border 1 = Draw a border int Options);