Qt PDF

Qt PDF 模塊包含用於渲染 PDF 文檔的類和函數。 QPdfDocument class loads a PDF document and renders pages from it according to the options provided by the QPdfDocumentRenderOptions 類。 QPdfPageRenderer class manages a queue that collects all render requests. The QPdfPageNavigation class handles the navigation through a PDF document.

使用模塊

使用 Qt 模塊要求直接或透過其它依賴鏈接到模塊庫。一些構建工具為此有貢獻支持,包括 CMake and qmake .

構建采用 CMake

使用 find_package() 命令定位所需模塊組件在 Qt5 包:

find_package(Qt5 COMPONENTS Pdf REQUIRED)
target_link_libraries(mytarget Qt5::Pdf)
					

另請參閱 構建采用 CMake 概述。

采用 qmake 構建

要包括模塊類定義,使用以下指令:

#include <QtPdf>
					

要鏈接到模塊,添加此行到 qmake 工程文件:

QT += pdf
					
					

文章和指南

  • Qt PDF 概述

範例

API 參考