Qt PDF

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 the Module

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.

Building with CMake

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.

Building with qmake

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

Articles and Guides

  • Qt PDF Overview

Examples

API Reference

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.