AddLinkToEmbeddedPDF
Annotations and hotspot links
Description
Adds a hotspot link to the selected page that opens a PDF document embedded in the current file and jumps to a page there. The link carries an embedded go-to (/GoToE) action per ISO 32000-1 §12.6.4.4: its target chain names the embedded file (the name passed to EmbedFile) in the document's EmbeddedFiles name tree, and the destination fits the target page in the window.
Because /GoToE was introduced with PDF 1.6, calling this function raises the document version to 1.6 when necessary. Use GetAnnotActionInfo to read such actions back: it reports the kind akGoToE together with the embedded target name, the parent/child relationship and the /NewWindow flag.
Syntax
Delphi
Function TPDFlib.AddLinkToEmbeddedPDF(Left, Top, Width, Height: Double; Const EmbeddedFileName: WideString; TargetPage, NewWindow, Options: Integer): Integer;
ActiveX
Function PDFlib::AddLinkToEmbeddedPDF(Left As Double, Top As Double, Width As Double, Height As Double, EmbeddedFileName As String, TargetPage As Long, NewWindow As Long, Options As Long) As Long
DLL
int DLAddLinkToEmbeddedPDF(int InstanceID, double Left, double Top, double Width, double Height, const wchar_t * EmbeddedFileName, int TargetPage, int NewWindow, int Options);
Parameters
| Left, Top, Width, Height | The position and size of the hotspot area on the selected page. |
|---|---|
| EmbeddedFileName | The name of the embedded file in the document's EmbeddedFiles name tree, as passed to EmbedFile (for example "report.pdf"). |
| TargetPage | The 1-based page in the embedded document to jump to. |
| NewWindow | 1 = ask the viewer to open the embedded document in a new window, 0 = viewer default. |
| Options | 1 = draw a border around the hotspot, 0 = no border. |
Return values
| 0 | The link could not be added (empty name or invalid page) |
|---|---|
| 1 | Success |