Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
DynaPDF.ChangeJavaScript
Replaces a global JavaScript with a new one.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
DynaPDF | 13.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "DynaPDF.ChangeJavaScript"; PDF; Index; JavaScript ) More
Parameters
Parameter | Description | Example |
---|---|---|
The PDF reference returned from DynaPDF.New. | ||
Index | The index for the JavaScript to change. Range from 0 to DynaPDF.GetJavaScriptCount-1. |
0 |
JavaScript | The new JavaScript to use. |
Result
Returns OK or error.
Description
Replaces a global JavaScript with a new one.The parameter Index must be a valid handle of a global JavaScript. 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.
See also ChangeJavaScript function in DynaPDF manual.
Examples
Change JavaScript:
Set Variable [ $r ; Value: MBS("DynaPDF.ChangeJavaScript"; $pdf; 0; "function test() { return 123; }") ]
See also
- DynaPDF.AddJavaScript
- DynaPDF.ChangeJavaScriptAction
- DynaPDF.ChangeJavaScriptName
- DynaPDF.CheckFieldNames
- DynaPDF.DeleteJavaScripts
- DynaPDF.GetJavaScript
- DynaPDF.GetJavaScriptCount
- DynaPDF.New
- DynaPDF.SetFieldName
Release notes
- Version 13.2
Blog Entries
This function checks for a license.
Created 15th April 2023, last changed 15th April 2023