pdfCreateGoToAction
Create a GoTo action targeting an explicit destination on a page
| Exported names | pdfCreateGoToAction |
|---|
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
int32_t __stdcall pdfCreateGoToAction(PPDF IPDF, TDestType DestType, uint32_t PageNum, double a, double b, double c, double d);
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)):
TDestType = (dtXY_Zoom, dtFit, dtFitH_Top, dtFitV_Left,
dtFit_Rect, dtFitB, dtFitBH_Top, dtFitBV_Left);
Parameters
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle. |
DestType | TDestType | Destination fit mode; selects which of a..d are meaningful. |
PageNum | Cardinal | Target page (0-based, per the destination-array convention). |
a, b, c, d | Double | View 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 also — pdfCreateGoToActionEx, pdfCreateNamedDest
C# (P/Invoke)
public static extern int pdfCreateGoToAction(IntPtr IPDF, TDestType DestType, uint PageNum, double a, double b, double c, double d);
Object Creation
pdfCreateGoToAction
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.