|
ViewerPreferences 完全リファレンス
ViewerPreferences により、support する viewers で PDF documents がどのように表示されるか、および一部の default print settings がどのように initialize されるかを制御できます。現在の HotPDF library は 14 個の ViewerPreferences values と関連する InitialZoom property を support しています
Current Data Types
THPDFDirection = (LeftToRight, RightToLeft);
THPDFNonFullScreenPageMode = (
nfpmUseNone, nfpmUseOutlines, nfpmUseThumbs, nfpmUseOC, nfpmUseAttachments
);
THPDFPrintScaling = (psNone, psAppDefault);
THPDFDuplex = (dupSimplex, dupDuplexFlipShortEdge, dupDuplexFlipLongEdge);
THPDFPageBoundary = (pbMediaBox, pbCropBox, pbBleedBox, pbTrimBox, pbArtBox);
THPDFInitialZoom = (
FitNone, FitPage, FitWidth, FitHeight, FitBox, FitBoxWidth, FitBoxHeight,
Zoom50, Zoom75, Zoom100, Zoom125, Zoom150, Zoom200
);
THPDFViewerPreference = (
vpHideToolbar, vpHideMenubar, vpHideWindowUI, vpFitWindow, vpCenterWindow,
vpDisplayDocTitle, vpDirection, vpNonFullScreenPageMode, vpPrintScaling,
vpDuplex, vpPickTrayByPDFSize, vpNumCopies, vpPrintArea, vpPrintClip,
vpViewArea, vpViewClip
);
THPDFViewerPreferences = set of THPDFViewerPreference;
Supported ViewerPreferences
| Option |
Companion Property |
説明 |
| vpHideToolbar |
なし |
ビューアのツールバーを非表示にします |
| vpHideMenubar |
なし |
ビューアのメニューバーを非表示にします |
| vpHideWindowUI |
なし |
スクロールバーやナビゲーションコントロールなどの UI 要素を非表示にします |
| vpFitWindow |
なし |
最初に表示するページに合わせてドキュメントウィンドウのサイズを変更します |
| vpCenterWindow |
なし |
ドキュメントウィンドウを画面中央に配置します |
| vpDisplayDocTitle |
Title |
ビューアのキャプションにファイル名ではなくドキュメントタイトルを表示します |
| vpDirection |
Direction |
主な読み順を LeftToRight または RightToLeft で保存します |
| vpNonFullScreenPageMode |
NonFullScreenPageMode |
全画面モードを終了した後に使用するページモードを選択します |
| vpPrintScaling |
PrintScaling |
既定の印刷スケーリングとして psNone または psAppDefault を選択します |
| vpDuplex |
Duplex |
片面または両面印刷の動作を選択します |
| vpPickTrayByPDFSize |
なし |
PDF のページサイズに基づく給紙トレイの選択を要求します |
| vpNumCopies |
NumCopies |
推奨される印刷部数を保存します |
| vpPrintArea |
PrintArea |
印刷レンダリングに使用するページ境界を選択します |
| vpPrintClip |
PrintClip |
印刷クリッピングに使用するページ境界を選択します |
| vpViewArea |
ViewArea |
画面表示領域に使用するページ境界(PDF 1.4 12.2)。HotPDF v2.29.0 以降で利用できます |
| vpViewClip |
ViewClip |
画面表示のクリッピングに使用するページ境界(PDF 1.4 12.2)。HotPDF v2.29.0 以降で利用できます |
Companion Property Values
これらの properties は、対応する ViewerPreferences flag が enabled の場合にのみ書き込まれます
| プロパティ |
Values |
| Direction |
LeftToRight, RightToLeft |
| NonFullScreenPageMode |
nfpmUseNone, nfpmUseOutlines, nfpmUseThumbs, nfpmUseOC, nfpmUseAttachments |
| PrintScaling |
psNone, psAppDefault |
| Duplex |
dupSimplex, dupDuplexFlipShortEdge, dupDuplexFlipLongEdge |
| PrintArea / PrintClip / ViewArea / ViewClip |
pbMediaBox, pbCropBox, pbBleedBox, pbTrimBox, pbArtBox |
InitialZoom Integration
InitialZoom は、document を開いたときの initial page display mode を制御することで ViewerPreferences を補完します
既定値: HotPDF v2.3.11 以降、default value は FitHeight (PDF /FitV destination) です。そのため生成された documents は各 page が viewer window height に合わせられた状態で開きます。InitialZoom を FitNone に設定すると OpenAction を omit し、viewer 自身の default zoom に fallback させます
// Complete document presentation setup
HotPDF.ViewerPreferences := [vpFitWindow, vpCenterWindow, vpDisplayDocTitle];
HotPDF.InitialZoom := FitWidth;
// Technical document setup
HotPDF.ViewerPreferences := [vpDisplayDocTitle, vpPrintScaling];
HotPDF.InitialZoom := Zoom125;
// Presentation mode
HotPDF.ViewerPreferences := [vpFitWindow, vpHideToolbar, vpHideMenubar];
HotPDF.InitialZoom := FitPage;
Implementation Example
var
VPref: THPDFViewerPreferences;
begin
VPref := [vpFitWindow, vpCenterWindow, vpDisplayDocTitle];
if EnableDirection then
begin
Include(VPref, vpDirection);
HotPDF.Direction := RightToLeft;
end;
if EnablePrintScaling then
begin
Include(VPref, vpPrintScaling);
HotPDF.PrintScaling := psNone;
end;
HotPDF.ViewerPreferences := VPref;
HotPDF.InitialZoom := FitWidth;
end;
Compatibility Notes
- Adobe Reader/Acrobat: 通常、最も完全な ViewerPreferences support を提供します
- その他の viewers: これらの values は強制要件ではなく preferences であるため、support は viewer によって異なります
- 段階的な劣化: unsupported settings は conforming viewers により安全に無視されるはずです
Demo Applications
次の demos は現在の library support と同期されています:
- Demo\Delphi\ViewerPref
- Demo\CBuilder\ViewerPref
|