The Qt PDF module contains classes and functions for rendering PDF documents. The QPdfDocument class loads a PDF document and renders pages from it according to the options provided by the QPdfDocumentRenderOptions class. The QPdfPageRenderer class manages a queue that collects all render requests. The QPdfPageNavigation class handles the navigation through a PDF document.
Using a Qt module requires linking against the module library, either directly or through other dependencies. Several build tools have dedicated support for this, including CMake and qmake.
Use the find_package()
command to locate the needed module components in the Qt5
package:
find_package(Qt5 COMPONENTS Pdf REQUIRED) target_link_libraries(mytarget Qt5::Pdf)
See also the Build with CMake overview.
To include the definitions of the module's classes, use the following directive:
#include <QtPdf>
To link against the module, add this line to your qmake project file:
QT += pdf
© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-5.15/qtpdf-index.html