[Development] Qt PDF as a new TP module for Qt 5.14

Kai Köhne Kai.Koehne at qt.io
Mon Aug 12 14:35:06 CEST 2019


Hi,

I suggest to promote Qt PDF to a Qt module. For Qt 5.14, it will be in Tech Preview state, and Shawn Rutledge is volunteering to be the maintainer. Although still staying an independent library from the user's perspective, it will be hosted and built in the qtwebengine.git repository. Initially only the desktop platforms (Windows, Linux, macOS) would be supported.

Qt PDF is so far a Qt labs module [1]. It allows Qt applications to render/view PDF's in QWidget based applications [2], and is built on top of PDFium. However, development has been stagnant, also because it is built on top of a rather old version of PDFium.

Why wasn't PDFium updated? PDFium got merged into Chromium a while ago, and is nowadays built as part of Chromium, using their build system (gn). Updating qtpdf.git to ship with latest PDFium would require quite some work, and keeping it up to date would require continuous work, too - work that nobody was willing to invest into so far.

But it turns out that, since Qt 5.11, we have PDFium already in our sources, and we're actually also building it! It's part of the Qt WebEngine libs that use it for PDF rendering in HTML. So technically, you can already render PDF's by loading them into a Qt WebEngine page. Anyhow, not everybody wants to ship a web browser for 'just' rendering PDF's [3] ...

So the idea is that we leverage on the existing build infrastructure for PDFium in qtwebengine.git, and host and build the Qt PDF libraries there. This also means that PDFium will be updated as part of the regular Chromium updates in qtwebengine.git. qtwebengine.git would furthermore get configure flags so that you can build just the Qt PDF libs. And, to reiterate: The Qt PDF libraries will _not_ depend on Qt WebEngine libs at runtime.

What do you think? Are there any objections for going forward with this for Qt 5.14?

Regards

Kai

[1] https://github.com/qt-labs/qtpdf
[2] A Qt Quick API might come in the future
[3] Don't be fooled about the complexity of PDF though: It's quite a big spec, which - among other things - requires a JS engine!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20190812/025fe8ea/attachment.html>


More information about the Development mailing list