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

DynaPDF Manual - Page 165

Previous Page 164   Index   Next Page 166

Function Reference
Page 165 of 750
ChangeJavaScriptAction
Syntax:
SI32 pdfChangeJavaScriptAction(
const PPDF* IPDF,
// Instance pointer
UI32 AHandle,
// Handle of a JavaScript action
const char* NewScript) // New JavaScript
The function replaces the script of a JavaScript action with a new one. The parameter AHandle must
be a valid handle of a JavaScript action. The parameter NewScript must be a valid JavaScript. The
script is not checked by DynaPDF whether it is valid or not. Note that older Acrobat versions do not
support all JavaScript functions. Due to several bugs in certain Acrobat versions invalid scripts can
cause access violations in Adobe's Acrobat. Test your scripts carefully with all Acrobat versions
which must be supported.
Remarks:
This function is implemented in an Ansi and Unicode compatible version. Because JavaScript 1.2 is
not Unicode compatible, Unicode encoded scripts are translated to a platform specific encoding prior
to interpretation by the JavaScript engine. This conversion is done in the viewer application and can
cause errors. The usage of scripts in Unicode format should be avoided if possible.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
ChangeJavaScriptName
Syntax:
SI32 pdfChangeJavaScript(
const PPDF* IPDF, // Instance pointer
UI32 AHandle,
// Handle of global JavaScript
const char* Name) // New name of the script
This function changes the name of a global JavaScript. The parameter Name defines the name of this
script. This name is NOT used to identify a function inside the JavaScript; it is only used in Adobe's
Acrobat to select a specific script. The script name must be unique. Different scripts cannot not use
the same name.
Return value:
If the function succeeds the return value is 1. If the function fails the return value is 0.
 

Previous topic: ChangeJavaScript

Next topic: ChangeSeparationColor