API referenceCore SDK

pdfChangeJavaScriptAction

Replace the script of an existing JS action object (created

Exported namespdfChangeJavaScriptActionA, 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

C
BOOL32 __stdcall pdfChangeJavaScriptActionA(PPDF IPDF, uint32_t Handle, const char* NewScript);
BOOL32 __stdcall pdfChangeJavaScriptActionW(PPDF IPDF, uint32_t Handle, const wchar_t* NewScript);
Delphi
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

ParameterTypeDescription
IPDFPPDFInstance handle.
HandleCardinalHandle from pdfCreateJSAction.
NewScriptstringReplacement script text.

Return valueTRUE on success; FALSE if the handle is invalid, out of range, or does not identify a JavaScript action.

See alsopdfCreateJSAction

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Core SDK
Category

Core

Exported names

pdfChangeJavaScriptActionA pdfChangeJavaScriptActionW

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.