DynaPDF Manual - Page 444

Previous Page 443   Index   Next Page 445

Function Reference
Page 444 of 839
oeOnAfterPrinting
// PDF 1.4 -> Catalog only
}TObjEvent;
typedef enum
{
otAction,
otAnnotation,
otBookmark,
otCatalog,
// PDF 1.4
otField,
otPage,
otPageLink
}TObjType;
The function returns the script of a JavaScript Action. The return value is a pointer to the original
string buffer. This value must not be changed or freed.
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.
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.
 

Previous topic: GetJavaScriptAction (obsolete), GetJavaScriptAction2 (obsolete)

Next topic: GetJavaScriptCount, GetJavaScriptEx