API referenceCore SDK

pdfCreateNamedAction

Create one of the four standard viewer navigation actions

Purpose — Create one of the four standard viewer navigation actions (next/previous/first/last page).

Description — Registers action kind 2 with the PDF standard name string for Action: 0"NextPage", 1"PrevPage", 2"FirstPage", 3"LastPage". Any other value is treated as 0 ("NextPage") — there is no failure path for an out-of-range Action.

Declarations

C
int32_t __stdcall pdfCreateNamedAction(PPDF IPDF, int32_t Action);
Delphi
function pdfCreateNamedAction(const IPDF: PPDF; Action: Integer): Integer; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
ActionInteger0=NextPage, 1=PrevPage, 2=FirstPage, 3=LastPage; other values silently map to NextPage.

Return value — 1-based action handle (> 0), or 0 on an invalid handle.

Remarks — This 0..3 numbering is not the same as the TNamedAction enum ordinal you get back from pdfGetNamedAction's Action.AType (which is looked up by the resulting name string, and has a different ordinal order) — see that entry for the verified mapping table.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfCreateNamedAction(IntPtr IPDF, int Action);
Area
Core SDK
Category

Object Creation

Exported names

pdfCreateNamedAction

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.