THPDFViewer 与已加载门面 API 参考

本参考主题说明 HotPDF 库中公开 API 的行为、参数和使用方式

THPDFViewer

用这些成员承载 VCL 查看器、控制导航、连接观察者并暴露查看器状态

RefreshDocument FirstPage PriorPage NextPage LastPage ZoomIn ZoomOut RotateClockwise RotateCounterClockwise ResetViewRotation ResetView HighlightRegion ClearHighlightRegions

AddDocumentChangeHandler RemoveDocumentChangeHandler

Model RenderError Align Anchors Color PDFDocument PageIndex PageNumber Zoom ZoomMode ViewRotation InteractionMode HighlightColor PrefetchRadius RenderAtPhysicalDPI

PrefetchRadius 控制把多少邻近页面渲染进后台缓存;RenderAtPhysicalDPI 让渲染跟随显示器物理 DPI,而不是沿用旧的 96 DPI 基线

OnPageChange OnDocumentChange OnHighlightChange OnSearchChange OnViewRotationChange OnZoomChange OnRenderError OnMarqueeSelect

THPDFViewerModel

需要在测试或自动化中覆盖导航、搜索、命中测试、快照或打印时,可以不创建窗口直接使用该模型

BeginUpdate EndUpdate FirstPage PriorPage NextPage LastPage ZoomIn ZoomOut FindAll FindNext FindPrevious ClearSearch TryGetSearchHit TryGetActiveSearchHit

GetNextZoomLevel GetPreviousZoomLevel RotateClockwise RotateCounterClockwise ResetViewRotation ResetView ProcessKeyInput ProcessMouseWheel PagePointToView ViewPointToPage ApplyViewRotation

CreatePageSnapshot CreateCurrentPageSnapshot CreatePageThumbnail CreateCurrentPageThumbnail PrefetchPageSnapshots PrefetchCurrentPageSnapshots CreatePageRegionSnapshot CreateCurrentPageRegionSnapshot CreatePageMetafile CreateCurrentPageMetafile

DrawCurrentView PrintCurrentView SaveCurrentPageSnapshotToBMP SaveCurrentPageSnapshotToStream SaveCurrentPageSnapshot

AddHighlightRegion RemoveHighlightRegion ClearHighlightRegions TryGetHighlightRegion GetPageFormFieldIndices FindFormFieldAt FindNextFormField

Document PageCount PageIndex PageNumber Zoom ZoomMode ViewRotation SearchHitCount HighlightCount ActiveSearchHit UpdateCount

OnBeginUpdate OnEndUpdate OnHighlightChange OnPageChange OnZoomChange OnSearchChange OnViewRotationChange

THPDFViewerAction

Action 派生类使用标准 VCL action 契约,作用于已关联的查看器

ExecuteTarget HandlesTarget UpdateTarget Viewer

导航类 action:THPDFFirstPageAction、THPDFPriorPageAction、THPDFNextPageAction、THPDFLastPageAction

缩放类 action:THPDFActualSizeAction、THPDFFitPageAction、THPDFFitWidthAction、THPDFZoomInAction、THPDFZoomOutAction

查找与视图类 action:THPDFFindNextAction、THPDFClearSearchAction、THPDFRotateClockwiseAction、THPDFRotateCounterClockwiseAction、THPDFResetViewAction

查看器支持类型

THPDFViewerZoomMode 为 THPDFViewer 与 THPDFViewerModel 选择固定缩放、适应宽度、适应页面、实际大小或自定义缩放行为

THPDFViewerFormFieldIndices 保存 GetPageFormFieldIndices 为某个页面返回的从零开始的已加载表单字段索引

已加载门面集合

THPDFLoadedOutlineCollection 提供 Count、TryGet 和 FindByTitle

THPDFLoadedFormCollection 提供 Count、TryGet、TryGetByName、SetValue、SetReadOnly、Rename、Remove 和 Flatten

THPDFLoadedAnnotationCollection 提供 Count、TryGet、Remove 和 Flatten

THPDFLoadedResourceCollection 提供 FontCount、TryGetFont、ImageCount、TryGetImage 和 ExtractImage

THPDFLoadedDocumentFacade 公开 Document、Outlines、Forms、Annotations 和 Resources

相关主题

已加载文档工具包涵盖工作流示例与所有权规则

THPDFViewerModel 快照方法涵盖位图快照与缩略图

THPDFViewer 高亮与框选涵盖持久化的页面区域高亮