Main and QtPDF Build Instructions: Difference between pages

From Qt Wiki
(Difference between pages)
Jump to navigation Jump to search
 
(remove broken link to marketplace)
 
Line 1: Line 1:
{{LangSwitch}}
QtPdf binaries are available from the Qt installer; but here's how to build it yourself.
__NOTOC__


==Welcome to the Qt wiki==
==Building the 5.15 version==
Here the Qt community has gathered information on Qt over the years.


Everything here is created and maintained by the community.
*sources for QtPdf module are hosted within QtWebEngine repository. Let's clone and initialize the git repository:


Please take a look at the below information before you start contributing.
<pre>
$ git clone https://code.qt.io/qt/qtwebengine.git
$ cd qtwebengine
$ git checkout 5.15
$ git submodule update --init --recursive
$ cd ..
</pre>


{| style="width:100%; margin-top:10px; background:#fcfcfc; border:1px solid #ccc;"
*fortunately build of QtWebEngine itself is not necessary for QtPdf build; therefore let's configure shadow build with:
|
* [[About Qt|What is Qt?]]
* [[About Qt Wiki|Purpose of this wiki]]
* [[:Category:General|Overview]]
* There is also a [[Special:AllPages|complete listing of all pages.]]
|}


== Editing Info ==
<pre>
* '''[https://www.mediawiki.org/wiki/Help:Editing_pages MediaWiki help on editing pages]''': Comprehensive guides on wiki editing in general.
$ mkdir build
* '''[[Wiki Editing Hints]]''': Tips on how to edit this wiki.
$ cd build
* '''[[:Category:Articles needing cleanup|Articles needing cleanup]]''': A list of articles that might need polishing.
$ qmake ../qtwebengine -- -no-build-qtwebengine-core
* '''[[Wiki Improvement Ideas]]'''
</pre>


== Quick Access ([[Portal:Quick Access|Portal]]) ==
*you should see configuration summary after previous step:


{| class="wikitable" style="width:99%;"
<pre>
! colspan="7" class="wikitable-title" | Current Releases ([[Template:Release Information|All Releases]])
Configure summary:  
|-
! rowspan="2" class="wikitable-head" | Qt Version
! rowspan="2" class="wikitable-head" | State
! rowspan="2" class="wikitable-head" | New Features
! colspan="4" class="wikitable-head" | Download Online Installers ([http://www.qt.io/download/ All Downloads])
|-
! class="wikitable-head" | Linux (32 bit)
! class="wikitable-head" | Linux (64 bit)
! class="wikitable-head" | Mac
! class="wikitable-head" | Windows
|-
| Qt 4.8.7
| End-of-Life (as of December 2015)
|
| colspan="4" style="text-align:center" | [http://download.qt.io/official_releases/qt/4.8/4.8.7/ Go to download directory]
|-
| Qt 5.12
| [[Qt 5.12 Release|Long Term Support Release]]
| [[New Features in Qt 5.12]]
| colspan="4" style="text-align:center" | -
|-
| Qt 5.14
| [[Qt 5.14 Release|Standard Support]] 
| [[New Features in Qt 5.14]]
| colspan="4" style="text-align:center" | -
|-
| Qt 5.15
| [[Qt 5.15 Release|Long Term Support Release]] 
| [[New Features in Qt 5.15]]
| colspan="4" style="text-align:center" | -
|}


{| style="width:99%;"
Qt WebEngine Build Tools:
| style="vertical-align:top;width:33%;" | <div style="font-size:18px">Install / Build</div>
  Use System Ninja ....................... yes
* [[Install Qt 5 on openSUSE]]
  Use System Gn .......................... no
* [[Install Qt 5 on Ubuntu‏‎]]
  Jumbo Build Merge Limit ................ 8
* [[Building Qt 5 from Git‏‎]]
  Developer build ........................ no
* [[MinGW-64-bit‏‎]]
  QtWebEngine required system libraries:
* [[Visual Studio Add-in‏‎]]
    fontconfig ........................... yes
* [[Native Build of Qt5 on a Raspberry Pi‏|Native Build on Raspberry Pi]]
    dbus ................................. yes
* [[Install Qt 5 Dev Suite Windows]]
    nss .................................. yes
* [[Qt for WebAssembly]]
    khr .................................. yes
    glibc ................................ yes
  QtWebEngine required system libraries for qpa-xcb:
    x11 .................................. yes
    libdrm ............................... yes
    xcomposite ........................... yes
    xcursor .............................. yes
    xi ................................... yes
    xtst ................................. yes
  Optional system libraries used:
    re2 .................................. yes
    icu .................................. no
    libwebp, libwebpmux and libwebpdemux . yes
    opus ................................. yes
    ffmpeg ............................... no
    libvpx ............................... yes
    snappy ............................... yes
    glib ................................. yes
    zlib ................................. yes
    minizip .............................. yes
    libevent ............................. yes
    jsoncpp .............................. yes
    protobuf ............................. yes
    libxml2 and libxslt .................. yes
    lcms2 ................................ yes
    png .................................. yes
    JPEG ................................. yes
    harfbuzz ............................. yes
    freetype ............................. yes
    xkbcommon ............................ yes
Qt PDF:
  Support V8 ............................. no
  Support XFA ............................ no
  Support XFA-BMP ........................ no
  Support XFA-GIF ........................ no
  Support XFA-PNG ........................ no
  Support XFA-TIFF ....................... no
Qt PDF Widgets:
  Support Qt PDF Widgets ................. yes


| style="vertical-align:top;width:33%;" | <div style="font-size:18px">New to Qt 5</div>
Note: QtWebEngine build is disabled by user.
* [[Qt for Beginners‏‎]]
* [[Qt Creator Guidance]]
* [[:Category:HowTo|"How To" collection]]
* [[Transition from Qt 4.x to Qt5‏‎]]
* [[New Signal Slot Syntax‏‎]]
* [[RaspberryPi Beginners Guide| Raspberry Pi Beginners Guide]]
* [[ Building Qt for PocketCHIP]]


| style="vertical-align:top;width:33%;" | <div style="font-size:18px">General</div>
Note: The following modules are not being compiled in this configuration:
* [http://qt.io/download/ Download Qt]
    webenginecore
* [https://wiki.qt.io/Qt5Releasing Qt5 Releasing]
    webengine
* [[Qt Creator Releases]]
    webenginewidgets
* [[Qt project org faq| FAQ]]
* [http://forum.qt.io/ Forum] ([[ForumHelp|Help]])
* [http://doc.qt.io/ Reference documentation]
* [https://bugreports.qt.io/ Bug tracker]
* [[Books]]


|}
Qt is now configured for building. Just run 'make'.
Once everything is built, you must run 'make install'.
Qt will be installed into '/usr'.
</pre>


== Application Developers ([[Portal:Application Developers|Portal]]) ==
*QtPdf build will use '''gn''' and '''ninja''' to build Pdfium which is required for the QtPdf module.  Let's perform the build:
{| class="wikitable" style="width:100%;"
| [[Qt Creator Guidance|Qt Creator]]
| [[QtQuick]]
| [[XML]]
| [[JSON]]
| Network
| [[Web]]
| [[Qt Serial Port|Serial Port]]
| [[Database]]
|-
| [[Qt Localization|Localization]]
| Multimedia
| Bluetooth
| [[:Category:LanguageBindings|Language Bindings]]
| [[Widgets]]
| [[2D]]
| [[Threads]]
| [[Deploying]]
|-
| [[:Category:Tools|Tools]]
| [[Add-ons]]
| [[Porting]]
| [[Plugins]]
| [[Testing and Debugging|Testing]]
| [[Printing]]
| [[Handling_PDF#Using_QtPDF|PDF]]
| [[3D]]
| Sensors
|}


{| style="width:99%;"
<pre>
| style="vertical-align:top;width:33%;" | <div style="font-size:18px">Desktop ([[Portal:Desktop|Portal]])</div>
$ NINJAJOBS=-j4 make -j4 && make install
* [[Install Qt 5 on openSUSE]]
</pre>
* [[Install Qt 5 on Ubuntu]]
* [[How to Use QPushButton]]
* [[Qt Quick Tutorial]]
* [[Writing good tests]]
* [[Exporting a document to PDF]]


| style="vertical-align:top;width:33%;" | <div style="font-size:18px">Embedded ([[Portal:Embedded|Portal]])</div>
==Building the 6.3 version==
* [[Qt for Embedded Linux]]
* [[TIPandaBoard]]
* [[Qt on the BeagleBoard]]
* [[RaspberryPi Beginners Guide]]
* [[Supported Devices]]
* [[I.MX-6]]


| style="vertical-align:top;width:33%;" | <div style="font-size:18px">Mobile ([[Portal:Mobile|Portal]])</div>
*sources for QtPdf module are hosted within QtWebEngine repository. Let's clone and initialize the git repository:
* [[Android]]
* [[Tizen]]
* [[SailfishOS]]
* [[BlackBerry]]
* [[QtMultimedia_iOS]]
* [[Maps and Navigation API]]


|}
<pre>
$ git clone https://code.qt.io/qt/qtwebengine.git
$ cd qtwebengine
$ git checkout 6.3
$ git submodule update --init --recursive
$ cd ..
</pre>


== Contributors ([[Portal:Contributors|Portal]]) ==
* Install html5lib:
* [[Qt Contribution Guidelines]]
* [[:Category:Developing Qt|Developing Qt (overview)]]
* [[:Category:Developing Qt::Security|Security]]: Reporting security issues and the Qt Project Security Policy
* [[Qt Project Guidelines]] Guides and useful information for code contributors to the Qt Project
* [[:Category:Developing Qt::Guidelines|Guidelines]]: General guidelines regarding Qt code (excl. those specifically for code contributions to the Qt Project)
* [[:Category:Developing Qt::Instructions|Instructions]]: Instructions for set-up and tools
* [[:Category:Developing Qt::Documentation|Documentation]]: Resources regarding writing documentation and examples
* [[Qt contributors summit]]
* [[Qt Metrics Page Description]]
* [[Qt Marketplace Publisher Guidelines]]


== Special Interest ([[Portal:Special Interest|Portal]]) ==
pip3 install html5lib
* [[:Category:LanguageBindings|Language bindings]] ([[:Category:LanguageBindings|Overview]])
 
* [[OnlineCommunities|List of independent Qt community sites and <span class="caps">IRC</span> channels]]
*configure shadow build with:
* [[Defensive Publications]]
 
* [[Who Does What]]
<pre>
$ mkdir build
$ cd build
$ qt-configure-module ../qtwebengine -- -DFEATURE_qtwebengine_build=OFF
</pre>
 
*build the pdf
 
<pre>
$ cmake --build . --parallel
</pre>
 
Since QtPdf comes with Qml and Widget APIs examples using those can be found in examples/pdf and examples/pdfwidgets.
 
'''In case of any issues please open bug report for PDF component in https://bugreports.qt.io/<nowiki/>.'''
 
==Historical repository==
 
The older version in the [https://code.qt.io/cgit/qt-labs/qtpdf.git/ Qt Labs QtPDF repository] still exists, but development now continues in the [https://code.qt.io/cgit/qt/qtwebengine.git/tree/src/pdf qtwebengine repository].  This was prompted mainly by the upstream Chromium switch of build system from gyp to gn: it was some work to get qtwebengine building with that.  Chromium (and thus Qt WebEngine) includes PDFium already; so it was easier to build QtPDF from there than to fix the build in the other repository.

Latest revision as of 23:58, 28 June 2024

QtPdf binaries are available from the Qt installer; but here's how to build it yourself.

Building the 5.15 version

  • sources for QtPdf module are hosted within QtWebEngine repository. Let's clone and initialize the git repository:
$ git clone https://code.qt.io/qt/qtwebengine.git
$ cd qtwebengine
$ git checkout 5.15
$ git submodule update --init --recursive
$ cd ..
  • fortunately build of QtWebEngine itself is not necessary for QtPdf build; therefore let's configure shadow build with:
$ mkdir build
$ cd build
$ qmake ../qtwebengine -- -no-build-qtwebengine-core
  • you should see configuration summary after previous step:
Configure summary: 

Qt WebEngine Build Tools:
  Use System Ninja ....................... yes
  Use System Gn .......................... no
  Jumbo Build Merge Limit ................ 8
  Developer build ........................ no
  QtWebEngine required system libraries:
    fontconfig ........................... yes
    dbus ................................. yes
    nss .................................. yes
    khr .................................. yes
    glibc ................................ yes
  QtWebEngine required system libraries for qpa-xcb:
    x11 .................................. yes
    libdrm ............................... yes
    xcomposite ........................... yes
    xcursor .............................. yes
    xi ................................... yes
    xtst ................................. yes
  Optional system libraries used:
    re2 .................................. yes
    icu .................................. no
    libwebp, libwebpmux and libwebpdemux . yes
    opus ................................. yes
    ffmpeg ............................... no
    libvpx ............................... yes
    snappy ............................... yes
    glib ................................. yes
    zlib ................................. yes
    minizip .............................. yes
    libevent ............................. yes
    jsoncpp .............................. yes
    protobuf ............................. yes
    libxml2 and libxslt .................. yes
    lcms2 ................................ yes
    png .................................. yes
    JPEG ................................. yes
    harfbuzz ............................. yes
    freetype ............................. yes
    xkbcommon ............................ yes
Qt PDF:
  Support V8 ............................. no
  Support XFA ............................ no
  Support XFA-BMP ........................ no
  Support XFA-GIF ........................ no
  Support XFA-PNG ........................ no
  Support XFA-TIFF ....................... no
Qt PDF Widgets:
  Support Qt PDF Widgets ................. yes

Note: QtWebEngine build is disabled by user.

Note: The following modules are not being compiled in this configuration:
    webenginecore
    webengine
    webenginewidgets

Qt is now configured for building. Just run 'make'. 
Once everything is built, you must run 'make install'. 
Qt will be installed into '/usr'.
  • QtPdf build will use gn and ninja to build Pdfium which is required for the QtPdf module. Let's perform the build:
$ NINJAJOBS=-j4 make -j4 && make install

Building the 6.3 version

  • sources for QtPdf module are hosted within QtWebEngine repository. Let's clone and initialize the git repository:
$ git clone https://code.qt.io/qt/qtwebengine.git
$ cd qtwebengine
$ git checkout 6.3
$ git submodule update --init --recursive
$ cd ..
  • Install html5lib:
pip3 install html5lib
  • configure shadow build with:
$ mkdir build
$ cd build
$ qt-configure-module ../qtwebengine -- -DFEATURE_qtwebengine_build=OFF
  • build the pdf
$ cmake --build . --parallel

Since QtPdf comes with Qml and Widget APIs examples using those can be found in examples/pdf and examples/pdfwidgets.

In case of any issues please open bug report for PDF component in https://bugreports.qt.io/.

Historical repository

The older version in the Qt Labs QtPDF repository still exists, but development now continues in the qtwebengine repository. This was prompted mainly by the upstream Chromium switch of build system from gyp to gn: it was some work to get qtwebengine building with that. Chromium (and thus Qt WebEngine) includes PDFium already; so it was easier to build QtPDF from there than to fix the build in the other repository.