API referenceCore SDK

pdfDeleteActionFromObj

Detach an action from an object's action list — by the

C
int32_t __stdcall pdfDeleteActionFromObj(PPDF IPDF, int32_t ObjType, uint32_t ActHandle, uint32_t ObjHandle);
int32_t __stdcall pdfDeleteActionFromObjEx(PPDF IPDF, int32_t ObjType, uint32_t ObjHandle, uint32_t ActIndex);
Delphi
function pdfDeleteActionFromObj(const IPDF: PPDF; ObjType: Integer; ActHandle, ObjHandle: Cardinal): Integer; stdcall;
function pdfDeleteActionFromObjEx(const IPDF: PPDF; ObjType: Integer; ObjHandle, ActIndex: Cardinal): Integer; stdcall;

Purpose. Detach an action from an object's action list — by the action's own handle (pdfDeleteActionFromObj) or by its position in that object's action list (pdfDeleteActionFromObjEx).

Description. Unusual return-value convention, worth flagging explicitly: both return 0 on success and -1 on failure — the reverse of the "positive/non-zero means success" convention used almost everywhere else in this SDK (including these two functions' close siblings elsewhere in this volume). A caller treating any non-zero return as success will misinterpret this pair's failures as successes and vice versa.

Parameters.

ParameterDescription
IPDFDocument handle.
ObjTypeThe target object's kind (page/annotation/field/etc — same TObjType convention used by pdfGetActionHandle, Action Getters).
ActHandle*(plain)* The specific action's own handle.
ObjHandleThe owning object's handle.
ActIndex*(Ex only)* 0-based position within that object's action list.

Return value. 0 = success; -1 = failure (inverted from the usual convention — see description).

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfDeleteActionFromObj(IntPtr IPDF, int ObjType, uint ActHandle, uint ObjHandle);
Area
Core SDK
Category

Core

Exported names

pdfDeleteActionFromObj

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.