API referenceCore SDK

pdfGetObjActions

Retrieve the full list of actions attached to (ObjType,

CategoryActions
Notewith a real memory leak; see Remarks

Purpose — Retrieve the full list of actions attached to (ObjType, ObjHandle): the primary (index-0) action inline, and any additional (event, action) tuples as a singly-linked list walked via pdfGetObjEvent.

Declarations

C
int32_t __stdcall pdfGetObjActions(PPDF IPDF, TObjType ObjType, uint32_t ObjHandle, TPDFObjActions* Actions);
Delphi
function pdfGetObjActions(const IPDF: PPDF; ObjType: TObjType; ObjHandle: Cardinal; var Actions: TPDFObjActions): Integer; stdcall; external 'LumasPdf.dll';

TPDFObjActions / TPDFObjEvent:

Delphi
TPDFObjActions = record
  StructSize: Cardinal;
  Action:     Integer;      // primary (index-0) action handle, 0 if none
  ActionType: Integer;      // Ord(TActionType), or -1 (see the chapter gap note)
  Events:     Pointer;      // head of a singly-linked TPDFObjEvent list (may be nil)
end;
TPDFObjEvent = record
  StructSize: Cardinal;
  Action:     Integer;
  ActionType: Integer;
  Event:      Integer;
  Next:       Pointer;      // nil at the end of the list
end;

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
ObjTypeTObjTypeOwning object's type.
ObjHandleCardinalOwning object's handle.
ActionsTPDFObjActions*Receives the primary action inline and the rest as a linked list.

Return value — Total attachment count for this object (same value as pdfGetObjActionCount); 0 if none.

Memory & buffers — verified leak. Each call that returns more than one attached action allocates one heap node (New(node), Delphi TPDFObjEvent records) per tuple beyond the first, chained through Actions.Events. No corresponding Dispose call exists anywhere in this codebasepdfGetObjEvent only reads a node's fields and returns its Next pointer; it never frees the node it was given. Every call to pdfGetObjActions against an object with 2+ attached actions leaks one node per extra action, for the lifetime of the process. There is currently no API to reclaim this memory. If you enumerate multi-event objects at scale (many fields with multiple triggers, called repeatedly), be aware this accumulates.

See alsopdfGetObjActionCount

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfGetObjActions(IntPtr IPDF, TObjType ObjType, uint ObjHandle, ref TPDFObjActions Actions);
Area
Core SDK
Category

Getters

Exported names

pdfGetObjActions

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.