pdfDeleteActionFromObj
Detach an action from an object's action list — by the
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);
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.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
ObjType | The target object's kind (page/annotation/field/etc — same TObjType convention used by pdfGetActionHandle, Action Getters). |
ActHandle | *(plain)* The specific action's own handle. |
ObjHandle | The 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)
public static extern int pdfDeleteActionFromObj(IntPtr IPDF, int ObjType, uint ActHandle, uint ObjHandle);
Core
pdfDeleteActionFromObj
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.