API referenceAnnotations

pdfPageLink3

Four distinct ways to create an in-document jump Link

C
int32_t __stdcall pdfPageLink(PPDF IPDF, double PosX, double PosY, double Width, double Height, uint32_t DestPage);
int32_t __stdcall pdfPageLink2(PPDF IPDF, double PosX, double PosY, double Width, double Height, uint32_t NamedDest);
int32_t __stdcall pdfPageLink3A(PPDF IPDF, double PosX, double PosY, double Width, double Height, const char* NamedDest);
int32_t __stdcall pdfPageLinkEx(PPDF IPDF, double PosX, double PosY, double Width, double Height, int32_t DestType, uint32_t DestPage, double a, double b, double c, double d);
Delphi
function pdfPageLink(const IPDF: PPDF; PosX, PosY, Width, Height: Double; DestPage: Cardinal): Integer; stdcall;
function pdfPageLink2(const IPDF: PPDF; PosX, PosY, Width, Height: Double; NamedDest: Cardinal): Integer; stdcall;
function pdfPageLink3A(const IPDF: PPDF; PosX, PosY, Width, Height: Double; const NamedDest: PAnsiChar): Integer; stdcall;
function pdfPageLinkEx(const IPDF: PPDF; PosX, PosY, Width, Height: Double; DestType: Integer; DestPage: Cardinal; a, b, c, d: Double): Integer; stdcall;

Purpose. Four distinct ways to create an in-document jump Link annotation, differing in how the destination is specified.

Description. pdfPageLink is a simplified convenience wrapper: it always calls the underlying AddPageLinkH with a hardcoded DestType = 1 (/Fit-style, the simplest destination array kind) and all four destination-rect parameters zeroed — for anything beyond "jump to page X, default view," use pdfPageLinkEx instead. pdfPageLink2 targets a named destination by its handle (AddNamedDestLinkByHandleH — the handle from pdfCreateNamedDest, Actions & Named Destinations). pdfPageLink3 targets a named destination by its name string (AddNamedDestLinkH) — the by- name and by-handle forms are genuinely different lookup paths, not aliases of each other. pdfPageLinkEx is the fully general form, exposing DestType (the PDF destination-array kind — /XYZ, /Fit, /FitH, /FitV, /FitR, etc) and its up-to-4 numeric parameters (a/b/c/d — the zoom factor and/or left/top/right/bottom coordinates, interpreted per DestType) directly.

Parameters.

ParameterDescription
IPDFDocument handle.
PosX, PosY, Width, HeightLink's clickable rectangle on the current page.
DestPage*(PageLink/Ex)* Target page (1-based).
NamedDest*(PageLink2)* Named-destination handle. *(PageLink3)* Named-destination name string.
DestType*(Ex only)* PDF destination-array kind.
a, b, c, d*(Ex only)* Destination-array numeric parameters, meaning depends on DestType.

Return value. The new Link annotation's handle; 0 on failure (invalid IPDF, or an unresolvable named destination for 2/3).

See also. pdfCreateNamedDest, pdfChangeLinkAnnot.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfPageLink3A(IntPtr IPDF, double PosX, double PosY, double Width, double Height, [MarshalAs(UnmanagedType.LPStr)] string NamedDest);
public static extern int pdfPageLink3W(IntPtr IPDF, double PosX, double PosY, double Width, double Height, [MarshalAs(UnmanagedType.LPWStr)] string NamedDest);
Area
Annotations
Category

Core

Exported names

pdfPageLink3A pdfPageLink3W

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.