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

DynaPDF Manual - Page 397

Previous Page 396   Index   Next Page 398

Function Reference
Page 397 of 750
To enumerate all JavaScripts of a document use the function GetJavaScriptCount() and use this value
in a simple for statement:
LBOOL unicode;
UI32 len;
char* scriptA;
UI16* scriptW;
SI32 count = pdfGetJavaScriptCount();
for (i = 0; i < count; i++)
{
scriptA = pdfGetJavaScript(i, len, unicode);
if (scriptA)
{
if (unicode)
{
scriptW = (UI16*)scriptA; // String is in Unicode format
}else
{
}
}
}
Remarks:
To get a global JavaScript by using the script's name use the function GetJavaScriptEx().
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.
GetJavaScriptAction (obsolete)
Syntax:
char* pdfGetJavaScriptAction(
const PPDF* IPDF,
// Instance pointer
UI32 AHandle,
// Handle of a JavaScript action
UI32 ADDR Len,
// String length in characters
LBOOL ADDR Unicode) // If true, the return value is a Unicode string
The function returns the script of a JavaScript Action as string. The parameter AHandle must be a
valid handle of a JavaScript Action. 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 returned string is a pointer to the original value. Do not change or free the string.
This function is obsolete. Please use GetJavaScriptActionEx() instead.
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: GetJavaScript

Next topic: GetJavaScriptAction2 (obsolete)