pdfGetNamedAction
Read back a named (viewer-navigation) action's name and type.
| Category | Actions |
|---|
Purpose — Read back a named (viewer-navigation) action's name and type.
Description — Action.AType is derived by comparing the stored name string against the four values pdfCreateNamedAction can write ('FirstPage'/'LastPage'/'NextPage'/'PrevPage') and mapping each to its TNamedAction ordinal. This mapping is NOT the same integer sequence as pdfCreateNamedAction's own Action parameter — a genuine, verified asymmetry:
| String | pdfCreateNamedAction's Action int | TNamedAction ordinal returned here |
|---|---|---|
"NextPage" | 0 | naNextPage = 2 |
"PrevPage" | 1 | naPrevPage = 3 |
"FirstPage" | 2 | naFirstPage = 0 |
"LastPage" | 3 | naLastPage = 1 |
Do not assume the integer you pass to pdfCreateNamedAction round-trips as the same integer in Action.AType — it is looked up by name, and the two numbering schemes disagree by construction.
Declarations
BOOL32 __stdcall pdfGetNamedAction(PPDF IPDF, uint32_t Handle, TPDFNamedAction* Action);
function pdfGetNamedAction(const IPDF: PPDF; Handle: Cardinal; var Action: TPDFNamedAction): LongBool; stdcall; external 'LumasPdf.dll';
TPDFNamedAction:
TPDFNamedAction = record
StructSize: Cardinal;
Name: PAnsiChar; // engine-owned
NewWindow: Integer; // always -1 (viewer default) in this build
NextAction: Integer; // always -1 (no chained action support here)
NextActionType: TActionType; // meaningless while NextAction = -1
AType: TNamedAction;
end;
TNamedAction = (naFirstPage, naLastPage, naNextPage, naPrevPage, naGoBack,
naOpenDlg, naPrintDlg, naGeneralInfo, naFontsInfo, naSaveAs,
naSecurityInfo, naFitPage, naFullScreen, naDeletePages,
naQuit, naUserDefined);
Parameters
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle. |
Handle | Cardinal | Action handle from pdfCreateNamedAction. |
Action | TPDFNamedAction* | Receives the name/type; StructSize is written; NewWindow/NextAction are always -1. |
Return value — TRUE if Handle names a Named (kind 2) action; FALSE otherwise.
See also — pdfCreateNamedAction
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Getters
pdfGetNamedAction
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.