Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 400

Previous Page 399   Index   Next Page 401

Function Reference
Page 400 of 750
GetJavaScriptEx
Syntax:
char* pdfGetJavaScriptEx(
const PPDF* IPDF,
// Instance pointer
const char* Name,
// Name of the global JavaScript
UI32 ADDR Len,
// String length in characters
LBOOL ADDR Unicode) // If true, return value is a Unicode string
The function returns a global JavaScript as string by using the script's name instead of a handle to
identify the script. Each global JavaScript has a unique name that identifies the script; this name
must be passed to the parameter Name. See also AddJavaScript().
The parameter Len holds the string length in characters without null-terminator. If Unicode is true,
the return value is a Unicode string. Make a typecast to UI16* in the latter case. The parameters Len
and Unicode must both not be NULL.
The returned string is a pointer to the original value. Do not change or free the string.
To enumerate all JavaScripts of a document use the function GetJavaScriptCount() and use this value
in a simple for statement (see GetJavaScript() for further information).
Return values:
If the function succeeds the return value is the JavaScript as Ansi or Unicode string. If the function
fails the return value is NULL.
GetJavaScriptName
Syntax:
char* pdfGetJavaScriptName(
const PPDF* IPDF,
// Instance pointer
UI32 Handle,
// Handle of global JavaScript
UI32 ADDR Len,
// Name length in characters
LBOOL ADDR Unicode) // If true, the name is in Unicode format
The function returns the name of a global JavaScript. The parameter Handle must be a valid handle of
a global JavaScript. If the parameter Unicode is true the returned string is in Unicode format. Make a
typecast to UI16* in this case. The parameter Len holds the string length in characters.
Use the function GetJavaScriptCount() to determine the number of available scripts. The handles of
global JavaScripts are simple array indexes.
Return value:
If the function succeeds the return value is the JavaScript as Ansi or Unicode string. If the function
fails the return value is NULL.
 

Previous topic: GetJavaScriptCount

Next topic: GetLastTextPosX, GetLastTextPosY