API referenceCore SDK

pdfGetJavaScriptAction2

Read the script text and triggering event of the ActIndex-th

CategoryActions

Purpose — Read the script text and triggering event of the ActIndex-th attached action on (ObjType, ObjHandle), if it is a JavaScript action.

Declarations

C
const char* __stdcall pdfGetJavaScriptAction2(PPDF IPDF, TObjType ObjType, uint32_t ObjHandle, uint32_t ActIndex, uint32_t* Len, BOOL32* Unicode, TObjEvent* Event);
Delphi
function pdfGetJavaScriptAction2(const IPDF: PPDF; ObjType: TObjType; ObjHandle, ActIndex: Cardinal; var Len: Cardinal; var Unicode: LongBool; var Event: TObjEvent): PAnsiChar; stdcall; external 'LumasPdf.dll';

TObjEvent (from Lumas.Pdf.Types):

Delphi
TObjEvent = (oeNoEvent, oeOnOpen, oeOnClose, oeOnMouseUp, oeOnMouseEnter,
             oeOnMouseExit, oeOnMouseDown, oeOnFocus, oeOnBlur, oeOnKeyStroke,
             oeOnFormat, oeOnCalc, oeOnValidate, oeOnPageVisible,
             oeOnPageInVisible, oeOnPageOpen, oeOnPageClose, oeOnBeforeClosing,
             oeOnBeforeSaving, oeOnAfterSaving, oeOnBeforePrinting,
             oeOnAfterPrinting);

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
ObjTypeTObjTypeOwning object's type.
ObjHandleCardinalOwning object's handle.
ActIndexCardinalZero-based index into the attached-action list.
LenCardinal*Receives script length.
UnicodeBOOL32*Always FALSE — same caveat as pdfGetJavaScriptAction.
EventTObjEvent*Receives the triggering event stored for this attachment.

Return value — Script pointer, or NULL if ActIndex is out of range for this object or the action at that index is not JavaScript.

See alsopdfGetObjActions

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern IntPtr pdfGetJavaScriptAction2(IntPtr IPDF, TObjType ObjType, uint ObjHandle, uint ActIndex, ref uint Len, [MarshalAs(UnmanagedType.Bool)] ref bool Unicode, ref TObjEvent @Event);
Area
Core SDK
Category

Getters

Exported names

pdfGetJavaScriptAction2

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.