AddLinkToFileEx

註解與熱點連結

描述

在所選頁面加入可點擊的熱點矩形,連到另一份 PDF 文件的特定頁面與位置。熱點框線顏色可用 SetAnnotBorderColor 函式修改

與目標文件的連結只靠檔名,目標文件的頁面尺寸無從得知,因此 DestLeft、DestTop、DestRight 與 DestBottom 參數一律以點為單位,從目的地頁面 MediaBox 的左下角量起

語法

Delphi

Function TPDFlib.AddLinkToFileEx(Left, Top, Width, Height: Double; Const FileName: WideString; DestPage: Integer; NewWindow, Options, Zoom, DestType: Integer; DestLeft, DestTop, DestRight, DestBottom: Double): Integer;

ActiveX

Function PDFlib::AddLinkToFileEx(Left As Double, Top As Double, Width As Double, Height As Double, FileName As String, DestPage As Long, NewWindow As Long, Options As Long, Zoom As Long, DestType As Long, DestLeft As Double, DestTop As Double, DestRight As Double, DestBottom As Double) As Long

DLL

int DLAddLinkToFileEx(int InstanceID, double Left, double Top, double Width, double Height, const wchar_t * FileName, int DestPage, int NewWindow, int Options, int Zoom, int DestType, double DestLeft, double DestTop, double DestRight, double DestBottom);

參數

Left

熱點矩形左緣的水平座標

Top

熱點矩形上緣的垂直座標

Width

熱點矩形的寬度

Height

熱點矩形的高度

FileName

要連結的 PDF 文件路徑與檔名

DestPage

目的地文件中要連結的頁面

NewWindow

0 = 關閉目前文件,然後開啟新文件

1 = 在新視窗開啟目前文件

Options

指定連結的外觀:

0 = No border

1 = Draw a border

目的地物件使用的縮放百分比,有效值為 0 到 6400。只在 DestType = 1 時使用,其他 DestType 應設為 0

Zoom

DestType

1 = "XYZ" - 目標頁面定位到 Left 與 Top 參數指定的點,Zoom 參數指定縮放百分比

2 = "Fit" - 縮放整頁以符合視窗。其他參數都不會使用,應設為零

3 = "FitH" - 縮放頁面讓整個頁寬都可見。頁面高度可能高於或低於視窗高度。頁面垂直定位在 Top 參數指定的位置

4 = "FitV" - 縮放頁面讓整個頁高都可見。頁面寬度可能大於或小於視窗寬度。頁面水平定位在 Left 參數指定的位置

5 = "FitR" - 縮放頁面讓頁面上某個矩形區域可見。Left、Top、Right 與 Bottom 參數定義頁面上的矩形區域

6 = "FitB" - 縮放頁面讓其邊界框可見

7 = "FitBH" - 頁面垂直定位在 Top 參數指定的位置,並縮放讓邊界框的整個頁寬可見

8 = "FitBV" - 頁面水平定位在 Left 參數指定的位置,並縮放到剛好讓邊界框的整個頁高納入視窗

DestLeft

DestType = 1、4、5 與 8 使用的水平位置

DestTop

DestType = 1、3、5 與 7 使用的垂直位置

DestRight

矩形右緣的水平位置。DestType = 5 時使用

DestBottom

矩形底邊的水平位置。DestType = 5 時使用

double DestLeft, double DestTop, double DestRight, double DestBottom);

Height: Double; FileName: WideString; DestPage, NewWindow, Options, Zoom, DestType: Integer; DestLeft, DestTop, DestRight,