API referenceCore SDK

pdfCreateGoToAction

Create a GoTo action targeting an explicit destination on a page

Exported namespdfCreateGoToAction

Purpose — Create a GoTo action targeting an explicit destination on a page in this document.

Description — Registers action kind 0 with the destination type, page number, and up to four view parameters (a..d), whose meaning depends on DestType per the PDF destination-array spec: dtXY_Zoom uses a=left, b=top, c=zoom; dtFitH_Top/dtFitBH_Top use a=top; dtFitV_Left/ dtFitBV_Left use a=left; dtFit_Rect uses a=left, b=bottom, c=right, d=top; dtFit/dtFitB ignore a..d.

Declarations

C
int32_t __stdcall pdfCreateGoToAction(PPDF IPDF, TDestType DestType, uint32_t PageNum, double a, double b, double c, double d);
Delphi
function pdfCreateGoToAction(const IPDF: PPDF; DestType: TDestType; PageNum: Cardinal; a, b, c, d: Double): Integer; stdcall; external 'LumasPdf.dll';

TDestType (from Lumas.Pdf.Types, ordinals matter — passed as Ord(DestType)):

Delphi
TDestType = (dtXY_Zoom, dtFit, dtFitH_Top, dtFitV_Left,
             dtFit_Rect, dtFitB, dtFitBH_Top, dtFitBV_Left);

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
DestTypeTDestTypeDestination fit mode; selects which of a..d are meaningful.
PageNumCardinalTarget page (0-based, per the destination-array convention).
a, b, c, dDoubleView parameters per DestType (see Description).

Return value — 1-based action handle (> 0) on success, 0 if the handle is invalid. This function cannot otherwise fail — it only appends to an in-memory table.

Remarks — The returned handle is used with attach-to-object APIs (link annotations, bookmarks, field actions, the catalog /OpenAction) to wire the action into the document tree; creating the action alone does not make it reachable from any page or outline.

See alsopdfCreateGoToActionEx, pdfCreateNamedDest

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfCreateGoToAction(IntPtr IPDF, TDestType DestType, uint PageNum, double a, double b, double c, double d);
Area
Core SDK
Category

Object Creation

Exported names

pdfCreateGoToAction

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.