| Category | Actions |
|---|---|
| Note | with 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
int32_t __stdcall pdfGetObjActions(PPDF IPDF, TObjType ObjType, uint32_t ObjHandle, TPDFObjActions* Actions);
function pdfGetObjActions(const IPDF: PPDF; ObjType: TObjType; ObjHandle: Cardinal; var Actions: TPDFObjActions): Integer; stdcall; external 'LumasPdf.dll';
TPDFObjActions / TPDFObjEvent:
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
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle. |
ObjType | TObjType | Owning object's type. |
ObjHandle | Cardinal | Owning object's handle. |
Actions | TPDFObjActions* | 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 codebase — pdfGetObjEvent 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 also — pdfGetObjActionCount
C# (P/Invoke)
public static extern int pdfGetObjActions(IntPtr IPDF, TObjType ObjType, uint ObjHandle, ref TPDFObjActions Actions);
Getters
pdfGetObjActions
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.