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

DynaPDF Manual - Page 399

Previous Page 398   Index   Next Page 400

Function Reference
Page 399 of 750
The value of the parameter ObjHandle depends on the object type. If the object type is a page, the
page number must be used as object handle. The number of actions which are assigned to a specific
object is returned by the function GetObjActionCount(). The parameter ActIndex represents is array
index of the action that should be accessed. The first action in the array has the index 0.
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.
LBOOL pdfGetJavaScriptActionEx(
const PPDF* IPDF,
// Instance pointer
UI32 Handle,
// Action handle
struct TPDFJavaScriptAction* Action) // see below
struct TPDFJavaScriptAction
// 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.
// Script length in characters, not bytes!
// -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.
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: GetJavaScriptName