pdfCreateGoToEAction
Create a "go to embedded" action that opens a PDF embedded
| Exported names | pdfCreateGoToEActionA, pdfCreateGoToEActionW |
|---|
Purpose — Create a "go to embedded" action that opens a PDF embedded inside this document (or a related container) and jumps to a page or named destination in it.
Description — Registers action kind 11 with GotoPg=DestPage, a=NewWindow flag, and Text=Target (the embedded target's identifying name). When DestName is non-empty it is stored separately via SetActionDestNameH, exactly as for GoToR — the target-page destination and the named destination are independent; supplying both is valid, with the named destination taking precedence at the viewer's discretion per the PDF spec. Location/Source/SrcPage describe where the embedded file's related association starts the traversal (see TEmbFileLocation); they are accepted per the reference ABI shape but this engine's serializer does not further branch on Location/Source/SrcPage beyond passing Target/DestPage — do not rely on those three for anything beyond documentation intent.
Declarations
int32_t __stdcall pdfCreateGoToEActionA(PPDF IPDF, TEmbFileLocation Location, const char* Source, uint32_t SrcPage, const char* Target, const char* DestName, uint32_t DestPage, BOOL32 NewWindow);
int32_t __stdcall pdfCreateGoToEActionW(PPDF IPDF, TEmbFileLocation Location, const wchar_t* Source, uint32_t SrcPage, const wchar_t* Target, const wchar_t* DestName, uint32_t DestPage, BOOL32 NewWindow);
function pdfCreateGoToEActionA(const IPDF: PPDF; Location: TEmbFileLocation; const Source: PAnsiChar; SrcPage: Cardinal; const Target, DestName: PAnsiChar; DestPage: Cardinal; NewWindow: LongBool): Integer; stdcall; external 'LumasPdf.dll';
function pdfCreateGoToEActionW(const IPDF: PPDF; Location: TEmbFileLocation; const Source: PWideChar; SrcPage: Cardinal; const Target, DestName: PWideChar; DestPage: Cardinal; NewWindow: LongBool): Integer; stdcall; external 'LumasPdf.dll';
TEmbFileLocation:
TEmbFileLocation = (eflChild, eflChildAnnot, eflExternal,
eflExternalAnnot, eflParent, eflParentAnnot);
Parameters
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle. |
Location | TEmbFileLocation | Relationship of the embedded target to this document (accepted, not further branched — see Description). |
Source | string | Source-side identifying name (accepted, not further branched). |
SrcPage | Cardinal | Source-side page (accepted, not further branched). |
Target | string | Embedded target identifying name — stored and serialized. |
DestName | string | Named destination inside the target, or empty to use DestPage. |
DestPage | Cardinal | Target page inside the embedded file. |
NewWindow | BOOL32 | New-window hint — stored and serialized. |
Return value — 1-based action handle (> 0), or 0 on an invalid handle.
See also — pdfCreateGoToRAction
C# (P/Invoke)
public static extern int pdfCreateGoToEActionA(IntPtr IPDF, TEmbFileLocation Location, [MarshalAs(UnmanagedType.LPStr)] string Source, uint SrcPage, [MarshalAs(UnmanagedType.LPStr)] string Target, [MarshalAs(UnmanagedType.LPStr)] string DestName, uint DestPage, [MarshalAs(UnmanagedType.Bool)] bool NewWindow);
public static extern int pdfCreateGoToEActionW(IntPtr IPDF, TEmbFileLocation Location, [MarshalAs(UnmanagedType.LPWStr)] string Source, uint SrcPage, [MarshalAs(UnmanagedType.LPWStr)] string Target, [MarshalAs(UnmanagedType.LPWStr)] string DestName, uint DestPage, [MarshalAs(UnmanagedType.Bool)] bool NewWindow);
Object Creation
pdfCreateGoToEActionA
pdfCreateGoToEActionW
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.