API referenceCore SDK

pdfGetNamedAction

Read back a named (viewer-navigation) action's name and type.

CategoryActions

Purpose — Read back a named (viewer-navigation) action's name and type.

DescriptionAction.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:

StringpdfCreateNamedAction's Action intTNamedAction ordinal returned here
"NextPage"0naNextPage = 2
"PrevPage"1naPrevPage = 3
"FirstPage"2naFirstPage = 0
"LastPage"3naLastPage = 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

C
BOOL32 __stdcall pdfGetNamedAction(PPDF IPDF, uint32_t Handle, TPDFNamedAction* Action);
Delphi
function pdfGetNamedAction(const IPDF: PPDF; Handle: Cardinal; var Action: TPDFNamedAction): LongBool; stdcall; external 'LumasPdf.dll';

TPDFNamedAction:

Delphi
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

ParameterTypeDescription
IPDFPPDFInstance handle.
HandleCardinalAction handle from pdfCreateNamedAction.
ActionTPDFNamedAction*Receives the name/type; StructSize is written; NewWindow/NextAction are always -1.

Return valueTRUE if Handle names a Named (kind 2) action; FALSE otherwise.

See alsopdfCreateNamedAction

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
[return: MarshalAs(UnmanagedType.Bool)]
Area
Core SDK
Category

Getters

Exported names

pdfGetNamedAction

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.