DynaPDF Manual - Page 191

Previous Page 190   Index   Next Page 192

Function Reference
Page 191 of 839
Remarks:
This function is implemented in an Ansi and Unicode compatible version. However, 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.
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
 

Previous topic: ChangeFontStyle, ChangeFontStyleEx, ChangeJavaScript

Next topic: ChangeLinkAnnot, ChangeOCGName