DynaPDF Manual - Page 463

Previous Page 462   Index   Next Page 464

Function Reference
Page 463 of 860
The parameter Event is set to the event that causes the execution of the script. If the script is defined
in Unicode the parameter Len is set to the length in characters. Make a typecast to UI16* in this case
because Unicode scripts use 16 bit per character.
This function is obsolete. Please use GetObjActions() / GetJavaScriptActionEx() instead.
Return values:
If the function succeeds the return value is a pointer to the original script buffer. If the function fails
or if the action contains an empty script the return value is NULL. However, the function produces
an error on failure. If no error callback function is set, call GetErrorMessage() to determine whether
an error occurred.
GetJavaScriptActionEx
LBOOL pdfGetJavaScriptActionEx(
const PPDF* IPDF,
// Instance pointer
UI32 Handle,
// Action handle
struct TPDFJavaScriptAction* Action) // see below
struct TPDFJavaScriptAction
{
UI32
StructSize;
// Must be set to sizeof(TPDFJavaScriptAction).
const char* ScriptA;
// The script.
const UI16* ScriptW;
// Either the Ansi or Unicode string is set but never both.
UI32
ScriptLen;
// Script length in characters, not bytes!
SI32
NextAction;
// -1 or next action handle to be executed if any.
TActionType NextActionType; // Only set if NextAction is >= 0.
};
The function retrieves the script of a JavaScript action. The member StructSize must be initialized to
sizeof(TPDFJavaScriptAction) before calling the function. NextAction is the handle of the next action
that must be executed, if any.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
GetJavaScriptCount
Syntax:
SI32 pdfGetJavaScriptCount(
const PPDF* IPDF) // Instance pointer
The function returns the number of global JavaScripts contained in a document.
 

Previous topic: GetJavaScriptAction2 (obsolete)

Next topic: GetJavaScriptEx