API referenceCore SDK

pdfCreateNamedDest

Register a named destination (a string name mapped to a page +

Exported namespdfCreateNamedDestA, pdfCreateNamedDestW

Purpose — Register a named destination (a string name mapped to a page + view) for use by GoTo actions, outline items, or external links.

Description — Appends to the document's named-destination table (FNDName/FNDPage/FNDType/FNDa..d), a table separate from and unrelated to the action registry. Fails (returns 0) if Name is empty; otherwise always succeeds. a..d follow the same per-DestType meaning as pdfCreateGoToAction.

Declarations

C
int32_t __stdcall pdfCreateNamedDestA(PPDF IPDF, const char* Name, uint32_t DestPage, TDestType DestType, double a, double b, double c, double d);
int32_t __stdcall pdfCreateNamedDestW(PPDF IPDF, const wchar_t* Name, uint32_t DestPage, TDestType DestType, double a, double b, double c, double d);
Delphi
function pdfCreateNamedDestA(const IPDF: PPDF; const Name: PAnsiChar; DestPage: Cardinal; DestType: TDestType; a, b, c, d: Double): Integer; stdcall; external 'LumasPdf.dll';
function pdfCreateNamedDestW(const IPDF: PPDF; const Name: PWideChar; DestPage: Cardinal; DestType: TDestType; a, b, c, d: Double): Integer; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
NamestringDestination name key. Empty is rejected.
DestPageCardinalTarget page (0-based).
DestTypeTDestTypeFit mode — see pdfCreateGoToAction for a..d semantics per type.
a, b, c, dDoubleView parameters.

Return value — 1-based named-destination handle (> 0) on success, 0 on an invalid instance handle or an empty Name.

Remarks — Unlike the action table, duplicate Names are not merged here — calling this twice with the same name creates two separate entries (contrast with the JS name table's merge-on-insert behavior — see pdfChangeJavaScript).

See alsopdfCreateGoToActionEx, pdfChangeNamedDest

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfCreateNamedDestA(IntPtr IPDF, [MarshalAs(UnmanagedType.LPStr)] string Name, uint DestPage, TDestType DestType, double a, double b, double c, double d);
public static extern int pdfCreateNamedDestW(IntPtr IPDF, [MarshalAs(UnmanagedType.LPWStr)] string Name, uint DestPage, TDestType DestType, double a, double b, double c, double d);
Area
Core SDK
Category

Object Creation

Exported names

pdfCreateNamedDestA pdfCreateNamedDestW

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.