AddGlobalJavaScript

Document properties, JavaScript

Description

Adds JavaScript to a global location in the document.

For example, this allows functions to be defined which can then be called from JavaScript attached to events.

Syntax

Delphi

function TPDFlib.AddGlobalJavaScript(Const PackageName, JavaScript: WideString): Integer;

ActiveX

Function PDFlib::AddGlobalJavaScript(PackageName As String, JavaScript As String) As Long

DLL

int DLAddGlobalJavaScript(int InstanceID, wchar_t * PackageName, wchar_t * JavaScript);

Parameters

PackageNameThe name to store the JavaScript under. If any JavaScript is already stored under this name it will be removed and the new JavaScript will be stored in its place.
JavaScriptThe JavaScript to store globally under the specified package name.

Return values

0The PackageName was empty
1The JavaScript was stored successfully