New QtLabs PDF module

January 30, 2017 Shawn Rutledge

A couple of years ago during a hackathon, a couple of us wrote a Qt wrapper around PDFium, the open-source PDF rendering engine which is used for viewing PDFs in Chromium.  There have been a few fixes and improvements since then.  Now we (finally) have made this module available under the LGPLv3 license.

QPdfDocument can render a PDF page to a QImage, and there is QPdfBookmarkModel which can be used for a bookmarks view. There is an example application: a widget-based PDF viewer.

If you want to try it out, here’s how to get started:

git clone git://code.qt.io/qt-labs/qtpdf
cd qtpdf
git submodule update --init --recursive
qmake
make
cd examples/pdf/pdfviewer
qmake
make
./pdfviewer /path/to/my/file.pdf

qtpdf-example
There is some work in progress to add support for PDF in QtQuick, to treat it as an ordinary image format and to add support for multi-page image formats in general, but we don’t have any particular target release date yet.

The post New QtLabs PDF module appeared first on Qt Blog.

Previous
Qbs 1.7 released
Qbs 1.7 released

We are delighted to announce the release of Qbs 1.7 “Technical Ecstasy”! While Qbs 1.7.0 was actually relea...

Next Article
What’s New in Qt on Apple Platforms
What’s New in Qt on Apple Platforms

Note that throughout this blog post, the term “Apple Platforms” will be used to refer to all four Apple ope...