API referenceCore SDK

pdfGetJavaScriptAction

Read the script text of a JS action by handle.

CategoryActions

Purpose — Read the script text of a JS action by handle.

Declarations

C
const char* __stdcall pdfGetJavaScriptAction(PPDF IPDF, uint32_t Handle, uint32_t* Len, BOOL32* Unicode);
Delphi
function pdfGetJavaScriptAction(const IPDF: PPDF; Handle: Cardinal; var Len: Cardinal; var Unicode: LongBool): PAnsiChar; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
HandleCardinalAction handle from pdfCreateJSAction.
LenCardinal*Receives the script length in bytes.
UnicodeBOOL32*Always FALSE — this getter reports the script as ANSI regardless of whether it was created via the W (Unicode-encoded via PWideToPdfText) or A variant; the underlying TPDFError-adjacent buffer is a single RawByteString.

Return value — Pointer to the script text, or NULL if Handle is not a JavaScript (kind 1) action.

Memory & buffers — Engine-owned, valid until the next call to this function on the same instance.

See alsopdfGetJavaScriptActionEx, pdfCreateJSAction

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern IntPtr pdfGetJavaScriptAction(IntPtr IPDF, uint Handle, ref uint Len, [MarshalAs(UnmanagedType.Bool)] ref bool Unicode);
Area
Core SDK
Category

Getters

Exported names

pdfGetJavaScriptAction

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.