TPDFlibViewer
ビューア
説明
TPDFlibViewer (ユニット Lib\PDFlibViewer.pas) は、アプリケーション内に PDF ページを表示する VCL のスクロールコントロールです。レンダリングには TPDFlib と同じエンジン (GDI+、Cairo、PDFium のいずれかで、接続したインスタンスの SelectRenderer に従います) を使います。
主要メンバー
Function LoadFromFile(Const FileName, Password: WideString): Integer;
Procedure AttachLibrary(ALib: TPDFlib);
Property Lib: TPDFlib;
Procedure CloseDocument;
Function PageCount: Integer;
Function GoToPage(NewPage: Integer): Integer;
Function GoToPagePoint(NewPage: Integer; XPt, YPt: Double): Integer;
Procedure ScrollBy(DX, DY: Integer);
Function GetScrollPosForPage(APage: Integer): Integer;
Function ClientPointToPage(X, Y: Integer; Out APage: Integer; Out XPt, YPt: Double): Boolean;
Function PageRectToClientRect(APage: Integer; XPt, YPt, WPt, HPt: Double; Out R: TRect): Boolean;
Property HScrollPos: Integer;
Property VScrollPos: Integer;
Function NextPage: Integer;
Function PrevPage: Integer;
Procedure SetZoomPercent(Percent: Double);
Property ZoomPercent: Double;
Procedure SetZoomMode(Mode: TPDFlibViewerZoomMode);
Property ZoomMode: TPDFlibViewerZoomMode;
Procedure SetDisplayMode(Mode: TPDFlibViewerDisplayMode);
Procedure SetCacheLimit(MegaBytes: Integer);
Function IsPageCached(APage: Integer): Boolean;
Procedure DrainPrefetched;
Property Cache: TPDFlibViewerBitmapCache;
Procedure RefreshPage;
Function RenderedWidth: Integer;
Function RenderedHeight: Integer;
Function EffectiveZoomPercent: Double;
Function LinkActionAtPagePoint(APage: Integer; XPos, YPos: Double; Out Info: TPDFlibActionInfo): Integer;
Function AnnotAtPagePoint(APage: Integer; XPos, YPos: Double; Out Subtype: WideString): Integer;
Function SaveAnnotAttachmentToFile(APage, AnnotIndex: Integer; Const FileName: WideString): Integer;
Property AnnotHints: Boolean;
Property OnAnnotClick: TPDFlibViewerAnnotClick;
Function FormFieldAtPagePoint(APage: Integer; XPos, YPos: Double): Integer;
Function GetFormFieldPageRect(FieldIndex: Integer; Out APage: Integer; Out XPt, YPt, WPt, HPt: Double): Boolean;
Function ToggleCheckBoxField(FieldIndex: Integer): Integer;
Function SetFormFieldValueAndRefresh(FieldIndex: Integer; Const NewValue: WideString): Integer;
Function BeginEditFormField(FieldIndex: Integer): Integer;
Procedure CommitInplaceEditor(Save: Boolean);
Function FocusNextFormField(Backwards: Boolean= False): Integer;
Function SaveToFile(Const FileName: WideString): Integer;
Function SaveToStream(OutStream: TStream): Integer;
Property HighlightFormFields: Boolean;
Property FormHighlightColor: TColor;
Property InteractiveForms: Boolean;
Property InteractiveAnnotations: Boolean;
Property AutoExecuteFormScripts: Boolean;
Property FormTextColor: TColor;
Property OnFormFieldValueChanged: TPDFlibViewerFormFieldChange;
Function GetFormFieldTabSequence(Out FieldIndices: TPDFlibViewerFormFieldIndices): Integer;
Function GetFormFieldEditorKind(FieldIndex: Integer): TPDFlibViewerFormEditorKind;
Function ActivateFormField(FieldIndex: Integer; Const TriggerEvent: WideString= 'U'): Integer;
Property EditingFieldIndex: Integer;
Property FocusedFormFieldIndex: Integer;
Property OnFormFieldAction: TPDFlibViewerFormFieldAction;
Function GetTextInRegion(APage: Integer; XPos, YPos, RWidth, RHeight: Double): WideString;
Function CopySelectedText: Integer;
Property ViewerMode: TPDFlibViewerMode;
Function CaptureRegion(Const Region: TRect): TBitmap;
Function CaptureCurrentView: TBitmap;
Function SaveCurrentViewToFile(Const FileName: WideString): Integer;
Function SelectRegion(APage: Integer; XPos, YPos, RWidth, RHeight: Double): Integer;
Function GetSelectedRegion(Index: Integer; Out Selection: TPDFlibViewerSelection): Boolean;
Procedure ClearSelectedRegions;
Function SelectedRegionCount: Integer;
Property SelectionColor: TColor;
Property OnMarqueeSelect: TPDFlibViewerMarqueeSelect;
Procedure AddHighlightRegion(APage: Integer; XPos, YPos, RWidth, RHeight: Double);
Procedure ClearHighlightRegions;
Function HighlightRegionCount: Integer;
Function CommitHighlightRegionsToAnnotations: Integer;
Property HighlightColor: TColor;
Property DrawColor: TColor;
Property DrawLineWidth: Double;
Function CommitDrawnShape(Mode: TPDFlibViewerMode; Const ClientPoints: Array Of TPoint): Integer;
Function HighlightSearchHits(Const Query: WideString; CaseSensitive: Boolean= False): Integer;
Procedure ClearSearchHighlights;
Function SearchHighlightCount: Integer;
Property SearchHighlightColor: TColor;
Property SnapshotToClipboard: Boolean;
Property DiskCacheFolder: WideString;
Property DiskCacheHits: Integer;
Property DiskCacheMaxDocuments: Integer;
Property PrefetchEnabled: Boolean;
Property OnBeforeSnapshot: TPDFlibViewerBeforeSnapshot;
Property OnSnapshot: TPDFlibViewerSnapshot;
Function PrintDoc(ShowPrintDialog: Boolean= True): Integer;
Function PrintDocRange(Const PrinterName: WideString; StartPage, EndPage, Copies: Integer; Collate: Boolean): Integer;
Procedure ZoomInStep;
Procedure ZoomOutStep;
Procedure RotateClockwise90;
Procedure RotateAntiClockwise90;
Property ViewRotation: Integer;
Property SelectedText: WideString;
Property Page: Integer;
Property ScreenDPI: Integer;
Property DisplayMode: TPDFlibViewerDisplayMode;
Property ScrollHintEnabled: Boolean;
Property OnZoomChange: TPDFlibViewerZoomChange;
Property OnHScroll: TPDFlibViewerScroll;
Property OnVScroll: TPDFlibViewerScroll;
Property OnPageChange: TPDFlibViewerPageChange;
Property OnLinkClick: TPDFlibViewerLinkClick;備考
LoadFromFile はコントロール自身の TPDFlib インスタンスを通じて文書を開き、AttachLibrary は利用者が管理するインスタンスの選択文書を表示します(所有権は呼び出し元にあります)。ズーム、表示、ナビゲーション、スクロール、キャッシュ、フォーム編集、検索、注釈、印刷、および関連するビューアコントロールとアクションの詳細な動作を説明します。関連する API は次のとおりです: zmPercent SetZoomPercent zmFitWidth zmFitPage OnPageChange OnZoomChange OnHScroll OnVScroll ScrollHintEnabled GoToPagePoint ScrollBy HScrollPos VScrollPos GetScrollPosForPage ClientPointToPage PageRectToClientRect SetDisplayMode dmSinglePage dmContinuous SetCacheLimit DiskCacheFolder DiskCacheHits ZoomInStep ZoomOutStep PrefetchEnabled DiskCacheMaxDocuments OnBeforeSnapshot OnLinkClick TPDFlibActionInfo LinkActionAtPagePoint GetAnnotRectEx OnAnnotClick AnnotAtPagePoint AnnotHints ShowHint SaveAnnotAttachmentToFile OnFormFieldValueChanged HighlightFormFields FormFieldAtPagePoint ToggleCheckBoxField SetFormFieldValueAndRefresh BeginEditFormField FocusNextFormField SaveToFile SaveToStream CopySelectedText GetTextInRegion ViewerMode vmSelect vmHand vmZoom vmSnapshot OnSnapshot vmHighlight CaptureRegion AddHighlightRegion ClearHighlightRegions HighlightColor PrintDoc PrintDoc(False) PrintDocRange RotateClockwise90 RotateAntiClockwise90 ViewRotation TPDFlibOutlineViewer AttachViewer HighlightSearchHits SearchHighlightColor ClearSearchHighlights TPDFlibSearchPanel RunSearch HighlightInView TPDFlibThumbnailBar Lib\PDFlibViewerActions.pas TAction Viewer TPDFlibViewerFirstPage TPDFlibViewerPriorPage TPDFlibViewerNextPage TPDFlibViewerLastPage TPDFlibViewerZoomIn TPDFlibViewerZoomOut TPDFlibViewerFitWidth TPDFlibViewerFitPage TPDFlibViewerActualSize TPDFlibViewerRotateClockwise TPDFlibViewerRotateAntiClockwise TPDFlibViewerPrint TPDFlibViewerFileOpen TPDFlibViewerFileSaveAs TPDFlibViewerCopyText TPDFlibViewerSelectMode TPDFlibViewerHandMode TPDFlibViewerMarqueeZoomMode TPDFlibViewerSnapshotMode TPDFlibViewerHighlightMode Lib\PDFlibViewerPkg.dpk RenderedWidth RenderedHeight EffectiveZoomPercent ScreenDPI IsPageCached Cache DrainPrefetched Lib TPDFlib GetFormFieldTabSequence GetFormFieldEditorKind ActivateFormField EditingFieldIndex FocusedFormFieldIndex OnFormFieldAction '''''''''''''''–""