pdfCreateGoToRActionEx
GoToR variant that targets a named destination in the remote
| Exported names | pdfCreateGoToRActionExA, pdfCreateGoToRActionExW |
|---|
Purpose — GoToR variant that targets a named destination in the remote file instead of a page number.
Description — Registers action kind 4 with GotoPg=0 and the file name in Text; when DestName is non-empty it is stored separately via SetActionDestNameH (not concatenated into the file-name text). Both the A and W exported variants take FileName as PAnsiChar — only DestName switches encoding between the two; this differs from the usual A/W convention where both string parameters switch together. Use pdfCreateGoToRActionExU if the file name itself must be Unicode.
Declarations
int32_t __stdcall pdfCreateGoToRActionExA(PPDF IPDF, const char* FileName, const char* DestName, BOOL32 NewWindow);
int32_t __stdcall pdfCreateGoToRActionExW(PPDF IPDF, const char* FileName, const wchar_t* DestName, BOOL32 NewWindow);
function pdfCreateGoToRActionExA(const IPDF: PPDF; const FileName: PAnsiChar; DestName: PAnsiChar; NewWindow: LongBool): Integer; stdcall; external 'LumasPdf.dll';
function pdfCreateGoToRActionExW(const IPDF: PPDF; const FileName: PAnsiChar; DestName: PWideChar; NewWindow: LongBool): Integer; stdcall; external 'LumasPdf.dll';
Parameters
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle. |
FileName | PAnsiChar | Target file, ANSI in both variants (see Description). |
DestName | string | Named destination in the remote file; ANSI (Ex A) or UTF-16 (ExW). |
NewWindow | BOOL32 | Whether the viewer should open the target in a new window. |
Return value — 1-based action handle (> 0), or 0 on an invalid handle. NewWindow is stored but the PDF /NewWindow flag's viewer support is consumer-dependent.
Remarks — NewWindow is accepted per-parameter (not swallowed), unlike pdfCreateLaunchAction's OP/DefDir/Param (see that entry) — it is written into the action's stored view state and reaches the serialized file.
See also — pdfCreateGoToRActionExU, pdfCreateGoToRAction
C# (P/Invoke)
public static extern int pdfCreateGoToRActionExA(IntPtr IPDF, [MarshalAs(UnmanagedType.LPStr)] string FileName, IntPtr DestName, [MarshalAs(UnmanagedType.Bool)] bool NewWindow);
public static extern int pdfCreateGoToRActionExW(IntPtr IPDF, [MarshalAs(UnmanagedType.LPStr)] string FileName, IntPtr DestName, [MarshalAs(UnmanagedType.Bool)] bool NewWindow);
Object Creation
pdfCreateGoToRActionExA
pdfCreateGoToRActionExW
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.