pdfCreateNamedDest
Register a named destination (a string name mapped to a page +
| Exported names | pdfCreateNamedDestA, 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
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);
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
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle. |
Name | string | Destination name key. Empty is rejected. |
DestPage | Cardinal | Target page (0-based). |
DestType | TDestType | Fit mode — see pdfCreateGoToAction for a..d semantics per type. |
a, b, c, d | Double | View 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 also — pdfCreateGoToActionEx, pdfChangeNamedDest
C# (P/Invoke)
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);
Object Creation
pdfCreateNamedDestA
pdfCreateNamedDestW
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.