pdfChangeJavaScriptAction
Replace the script of an existing JS action object (created
| Exported names | pdfChangeJavaScriptActionA, pdfChangeJavaScriptActionW |
|---|
Purpose — Replace the script of an existing JS action object (created by pdfCreateJSAction).
Description — Looks up Handle in the action table; fails unless the action at that handle is kind 1 (JavaScript). On success, overwrites its Text (the script) in place — the action's identity/handle and any attachments to it are unaffected.
Declarations
BOOL32 __stdcall pdfChangeJavaScriptActionA(PPDF IPDF, uint32_t Handle, const char* NewScript);
BOOL32 __stdcall pdfChangeJavaScriptActionW(PPDF IPDF, uint32_t Handle, const wchar_t* NewScript);
function pdfChangeJavaScriptActionA(const IPDF: PPDF; Handle: Cardinal; const NewScript: PAnsiChar): LongBool; stdcall; external 'LumasPdf.dll';
function pdfChangeJavaScriptActionW(const IPDF: PPDF; Handle: Cardinal; const NewScript: PWideChar): LongBool; stdcall; external 'LumasPdf.dll';
Parameters
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle. |
Handle | Cardinal | Handle from pdfCreateJSAction. |
NewScript | string | Replacement script text. |
Return value — TRUE on success; FALSE if the handle is invalid, out of range, or does not identify a JavaScript action.
See also — pdfCreateJSAction
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Core
pdfChangeJavaScriptActionA
pdfChangeJavaScriptActionW
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.