THotPDF.InitialZoom Property

 

THotPDF.InitialZoom

THotPDF

 

傳回頂部  上一頁  下一頁

控制寫入檔案 OpenAction 項目的初始頁面顯示縮放。PDF readers 開啟檔案時會採用此值

 

type

THPDFInitialZoom = (

     FitNone, FitPage, FitWidth, FitHeight, FitBox,

     FitBoxWidth, FitBoxHeight,

     Zoom50, Zoom75, Zoom100, Zoom125, Zoom150, Zoom200);

 

Delphi 語法:

property InitialZoom: THPDFInitialZoom;

 

C++ 語法:

__property THPDFInitialZoom InitialZoom;

 

說明

使用 InitialZoom 設定檔案開啟時的 page-display mode。HotPDF 會將此值寫入檔案的 /OpenAction 項目,作為 PDF specification 定義的標準 PDF view destinations 之一(Fit、FitH、FitV、FitR、FitB、FitBH、FitBV 或 XYZ)

自 HotPDF v2.3.11 起,預設值為 FitHeight(PDF /FitV destination),因此產生的檔案開啟時每頁會符合 viewer 的視窗高度。將 InitialZoom 設為 FitNone 可省略 OpenAction 項目,讓 viewer fallback 到自己的預設縮放

 

Value              PDF destination    Meaning


FitNone           (none)            No special zoom; let the viewer use its own default.

FitPage           /Fit              Fit the entire page inside the window.

FitWidth          /FitH             Fit page width to the window.

FitHeight         /FitV             Fit page height to the window. (default)

FitBox            /FitR or /FitB     將頁面內容的 bounding box 符合到視窗

FitBoxWidth      /FitBH          Fit the bounding box width to the window.

FitBoxHeight     /FitBV          Fit the bounding box height to the window.

Zoom50            /XYZ null null 0.5       Open the page at 50% scale.

Zoom75            /XYZ null null 0.75      Open the page at 75% scale.

Zoom100          /XYZ null null 1.0       Open the page at 100% (actual size).

Zoom125          /XYZ null null 1.25      Open the page at 125% scale.

Zoom150          /XYZ null null 1.5       Open the page at 150% scale.

Zoom200          /XYZ null null 2.0       Open the page at 200% scale.

 

如需了解 InitialZoom 如何與 PDF viewer-preferences dictionary 互動的高階總覽,請參閱 ViewerPreferences Complete Reference

 

Code Example

HPDF := THotPDF.Create( nil );
try
  HPDF.FileName  := 'c:\Output.pdf';
  HPDF.InitialZoom := FitWidth;       // Open with page width fitted to window
  HPDF.BeginDoc;
  HPDF.CurrentPage.TextOut( 100, 100, 0, 'Hello World!' );
  HPDF.EndDoc;
finally
  HPDF.Free;
end;