Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to build QtPdf?
Qt 6.11 is out! See what's new in the release blog

How to build QtPdf?

Scheduled Pinned Locked Moved Unsolved General and Desktop
22 Posts 3 Posters 8.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S slavaw

    Hello!
    I want to use QtPdf in my project. I use Qt 6.6.1 and Ubuntu 22.04 LTS.
    In Maintenance Tool Qt PDF and QT WebEngine selected.

    91f95107-484d-4db8-b359-18357620a15d-image.png

    In my Qt folder (home/Qt/6.6.1/Src/qtwebengine/src) I have ec15f2f3-f580-4dad-8181-358f47bf0072-image.png

    If I add "QT += pdf", I get error.
    b57498de-44f2-40f0-8efc-9b424da6012f-image.png
    c99253e7-509c-483a-a313-0d3b1c1ab64f-image.png

    I try to build QtPdf as it is said here - https://wiki.qt.io/QtPDF_Build_Instructions, but I cant execute this command:
    edc66af1-4cfa-458f-a8c3-4a53e4cabbb4-image.png

    Could you tell me how I should build QtPdf?

    jsulmJ Offline
    jsulmJ Offline
    jsulm
    Lifetime Qt Champion
    wrote on last edited by
    #2

    @slavaw said in How to build QtPdf?:

    but I cant execute this command

    What does this mean? What happens?

    https://forum.qt.io/topic/113070/qt-code-of-conduct

    S 1 Reply Last reply
    0
    • jsulmJ jsulm

      @slavaw said in How to build QtPdf?:

      but I cant execute this command

      What does this mean? What happens?

      S Offline
      S Offline
      slavaw
      wrote on last edited by
      #3

      @jsulm I get the error: "qt-configure-module: command not found".

      jsulmJ 1 Reply Last reply
      0
      • S slavaw

        Hello!
        I want to use QtPdf in my project. I use Qt 6.6.1 and Ubuntu 22.04 LTS.
        In Maintenance Tool Qt PDF and QT WebEngine selected.

        91f95107-484d-4db8-b359-18357620a15d-image.png

        In my Qt folder (home/Qt/6.6.1/Src/qtwebengine/src) I have ec15f2f3-f580-4dad-8181-358f47bf0072-image.png

        If I add "QT += pdf", I get error.
        b57498de-44f2-40f0-8efc-9b424da6012f-image.png
        c99253e7-509c-483a-a313-0d3b1c1ab64f-image.png

        I try to build QtPdf as it is said here - https://wiki.qt.io/QtPDF_Build_Instructions, but I cant execute this command:
        edc66af1-4cfa-458f-a8c3-4a53e4cabbb4-image.png

        Could you tell me how I should build QtPdf?

        JoeCFDJ Offline
        JoeCFDJ Offline
        JoeCFD
        wrote on last edited by JoeCFD
        #4

        @slavaw you add
        Qt += pdfwidgets

        To find out which modules to add, you can simply check a pdf example out.
        Are you making QML project?

        S 1 Reply Last reply
        0
        • S slavaw

          @jsulm I get the error: "qt-configure-module: command not found".

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #5

          @slavaw said in How to build QtPdf?:

          qt-configure-module: command not found

          then use absolute path to the command

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          S 1 Reply Last reply
          0
          • JoeCFDJ JoeCFD

            @slavaw you add
            Qt += pdfwidgets

            To find out which modules to add, you can simply check a pdf example out.
            Are you making QML project?

            S Offline
            S Offline
            slavaw
            wrote on last edited by
            #6

            @JoeCFD

            @JoeCFD said in How to build QtPdf?:

            Qt += pdfwidgets

            I try add this to my .pro file, but i got error again:
            5d6291a6-b987-4625-90af-006b8f3a2bd7-image.png

            @JoeCFD said in How to build QtPdf?:

            To find out which modules to add, you can simply check a pdf example out.

            I need to add QtPdf module to use QPdfDocument - https://doc.qt.io/qt-6/qtpdf-index.html

            @JoeCFD said in How to build QtPdf?:

            Are you making QML project?

            I make project, where QML using for view and C++ for logic. If it is important, I use qmake for build project.

            1 Reply Last reply
            0
            • jsulmJ jsulm

              @slavaw said in How to build QtPdf?:

              qt-configure-module: command not found

              then use absolute path to the command

              S Offline
              S Offline
              slavaw
              wrote on last edited by
              #7

              @jsulm said in How to build QtPdf?:

              then use absolute path to the command

              I found "qt-configure-module" in this folders (path home/Qt/6.6.1/): 82a2364e-f156-4847-bf91-87f8f6cb8b29-image.png
              Which of these files should I run? Android folders for Android, GCC for Windows, WASM for C languages. Come to think of it I'm using multithreading, so I need to execute file in "wasm_multithread/bin"?

              In the path "home/Qt/6.6.1/Src/qtbase/bin" i found "qt-configure-module.in" with this description inside: 59da9092-97d3-4c36-92e9-19269a64454d-image.png
              I tried to exec this file and get this error:
              f7eed7cf-bc89-4ece-bc0c-babc6b64ad11-image.png
              I checked path in error and not found "qt-cmake-private", but found it in this folders:
              c6de13de-c2f0-4270-8247-fe23c1627f23-image.png 013996de-e566-434c-9de8-2f9f198f77e0-image.png

              jsulmJ 1 Reply Last reply
              0
              • S slavaw

                @jsulm said in How to build QtPdf?:

                then use absolute path to the command

                I found "qt-configure-module" in this folders (path home/Qt/6.6.1/): 82a2364e-f156-4847-bf91-87f8f6cb8b29-image.png
                Which of these files should I run? Android folders for Android, GCC for Windows, WASM for C languages. Come to think of it I'm using multithreading, so I need to execute file in "wasm_multithread/bin"?

                In the path "home/Qt/6.6.1/Src/qtbase/bin" i found "qt-configure-module.in" with this description inside: 59da9092-97d3-4c36-92e9-19269a64454d-image.png
                I tried to exec this file and get this error:
                f7eed7cf-bc89-4ece-bc0c-babc6b64ad11-image.png
                I checked path in error and not found "qt-cmake-private", but found it in this folders:
                c6de13de-c2f0-4270-8247-fe23c1627f23-image.png 013996de-e566-434c-9de8-2f9f198f77e0-image.png

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #8

                @slavaw said in How to build QtPdf?:

                Which of these files should I run?

                The one you want to build for.

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                S 1 Reply Last reply
                0
                • jsulmJ jsulm

                  @slavaw said in How to build QtPdf?:

                  Which of these files should I run?

                  The one you want to build for.

                  S Offline
                  S Offline
                  slavaw
                  wrote on last edited by
                  #9

                  @jsulm said in How to build QtPdf?:

                  The one you want to build for.

                  I get the error again:
                  c6c91f19-f8f3-4c76-9b95-6cae6ddb7ab2-image.png

                  jsulmJ 1 Reply Last reply
                  0
                  • S slavaw

                    @jsulm said in How to build QtPdf?:

                    The one you want to build for.

                    I get the error again:
                    c6c91f19-f8f3-4c76-9b95-6cae6ddb7ab2-image.png

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #10

                    @slavaw Did you install Emscripten? As far as I know you need it to be able to build for Wasm.

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    S 1 Reply Last reply
                    0
                    • jsulmJ jsulm

                      @slavaw Did you install Emscripten? As far as I know you need it to be able to build for Wasm.

                      S Offline
                      S Offline
                      slavaw
                      wrote on last edited by slavaw
                      #11

                      @jsulm said in How to build QtPdf?:

                      Did you install Emscripten? As far as I know you need it to be able to build for Wasm.

                      I installed Emscripten, re-executed cmd and got the last error.

                      jsulmJ 1 Reply Last reply
                      0
                      • S slavaw

                        @jsulm said in How to build QtPdf?:

                        Did you install Emscripten? As far as I know you need it to be able to build for Wasm.

                        I installed Emscripten, re-executed cmd and got the last error.

                        jsulmJ Offline
                        jsulmJ Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on last edited by
                        #12

                        @slavaw Install Ninja

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        S 1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          slavaw
                          wrote on last edited by
                          #13

                          @jsulm said in How to build QtPdf?:

                          Install Ninja

                          I installed Ninja, tried again and got the same error.

                          1 Reply Last reply
                          0
                          • jsulmJ jsulm

                            @slavaw Install Ninja

                            S Offline
                            S Offline
                            slavaw
                            wrote on last edited by
                            #14

                            @jsulm I dug through the files and realized that my project was being built in the Src folder, but I found the "qt-configure-module" file only in "Src/qtbase/bin". I tried to execute cmd and get error.
                            9be2e2c5-a34a-47a0-a8d1-7b99057a7bc3-image.png
                            Src folder:
                            a55ba7c2-baa7-4288-99ed-a16cccadb910-image.png
                            Command execute:
                            6ec3d577-31f6-4a3e-ab3e-89ccf0be6e76-image.png

                            jsulmJ 1 Reply Last reply
                            0
                            • S slavaw

                              @jsulm I dug through the files and realized that my project was being built in the Src folder, but I found the "qt-configure-module" file only in "Src/qtbase/bin". I tried to execute cmd and get error.
                              9be2e2c5-a34a-47a0-a8d1-7b99057a7bc3-image.png
                              Src folder:
                              a55ba7c2-baa7-4288-99ed-a16cccadb910-image.png
                              Command execute:
                              6ec3d577-31f6-4a3e-ab3e-89ccf0be6e76-image.png

                              jsulmJ Offline
                              jsulmJ Offline
                              jsulm
                              Lifetime Qt Champion
                              wrote on last edited by
                              #15

                              @slavaw said in How to build QtPdf?:

                              my project was being built in the Src folder

                              Don't do that!
                              Checkout the source code again to get rid of all your build artefacts!
                              but I found the "qt-configure-module" file only in "Src/qtbase/bin" - this does not mean you have to build inside source forlder. As I already wrote before: use absolute path to qt-configure-module

                              https://forum.qt.io/topic/113070/qt-code-of-conduct

                              S 1 Reply Last reply
                              0
                              • jsulmJ jsulm

                                @slavaw said in How to build QtPdf?:

                                my project was being built in the Src folder

                                Don't do that!
                                Checkout the source code again to get rid of all your build artefacts!
                                but I found the "qt-configure-module" file only in "Src/qtbase/bin" - this does not mean you have to build inside source forlder. As I already wrote before: use absolute path to qt-configure-module

                                S Offline
                                S Offline
                                slavaw
                                wrote on last edited by
                                #16

                                @jsulm I hope I understood you correctly, but I got an error again.e631a176-a720-4e92-a0ce-df86932d609b-image.png

                                jsulmJ 1 Reply Last reply
                                0
                                • S slavaw

                                  @jsulm I hope I understood you correctly, but I got an error again.e631a176-a720-4e92-a0ce-df86932d609b-image.png

                                  jsulmJ Offline
                                  jsulmJ Offline
                                  jsulm
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #17

                                  @slavaw Why are you still building inside the sources?!

                                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  S 1 Reply Last reply
                                  0
                                  • jsulmJ jsulm

                                    @slavaw Why are you still building inside the sources?!

                                    S Offline
                                    S Offline
                                    slavaw
                                    wrote on last edited by
                                    #18

                                    @jsulm I tried to do as you said, along the path presented below, but it didn't help.
                                    7b1ee720-3dba-4505-a3e6-ff5bec1cb12d-image.png

                                    jsulmJ 1 Reply Last reply
                                    0
                                    • S slavaw

                                      @jsulm I tried to do as you said, along the path presented below, but it didn't help.
                                      7b1ee720-3dba-4505-a3e6-ff5bec1cb12d-image.png

                                      jsulmJ Offline
                                      jsulmJ Offline
                                      jsulm
                                      Lifetime Qt Champion
                                      wrote on last edited by
                                      #19

                                      @slavaw Why do you post pictures instead of text?
                                      "but it didn't help" - this is not a problem description. If it did not work then please tell us what happened...

                                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                                      S 1 Reply Last reply
                                      0
                                      • jsulmJ jsulm

                                        @slavaw Why do you post pictures instead of text?
                                        "but it didn't help" - this is not a problem description. If it did not work then please tell us what happened...

                                        S Offline
                                        S Offline
                                        slavaw
                                        wrote on last edited by slavaw
                                        #20

                                        @jsulm I think pictures are easier to understand, but if you insist:
                                        I reinstalled Emscripten, after install nodejs, flex, bison, gperf and now after execute (path ~/qtpdf/build):

                                        ~/Qt/6.6.1/gcc_64/bin/qt-configure-module ../qtwebengine -- -DFEATURE_qtwebengine_build=OFF
                                        
                                        

                                        QtPdf Module built succesfull, but CMake exited with error.
                                        45489d94-393f-4baa-9f7b-9ec157f2ca31-image.png

                                        Error:

                                        -- Configuring done
                                        CMake Error at /home/slava/Qt/6.6.1/gcc_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:2355 (add_library):
                                          Target "PdfWidgets" links to target "XKB::XKB" but the target was not
                                          found.  Perhaps a find_package() call is missing for an IMPORTED target, or
                                          an ALIAS target is missing?
                                        Call Stack (most recent call first):
                                          /home/slava/Qt/6.6.1/gcc_64/lib/cmake/Qt6/QtModuleHelpers.cmake:173 (_qt_internal_add_library)
                                          src/pdfwidgets/CMakeLists.txt:6 (qt_internal_add_module)
                                        
                                        
                                        CMake Error at /home/slava/Qt/6.6.1/gcc_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:2355 (add_library):
                                          Target "PdfQuick" links to target "XKB::XKB" but the target was not found.
                                          Perhaps a find_package() call is missing for an IMPORTED target, or an
                                          ALIAS target is missing?
                                        Call Stack (most recent call first):
                                          /home/slava/Qt/6.6.1/gcc_64/lib/cmake/Qt6/QtModuleHelpers.cmake:173 (_qt_internal_add_library)
                                          /home/slava/Qt/6.6.1/gcc_64/lib/cmake/Qt6Qml/Qt6QmlBuildInternals.cmake:164 (qt_internal_add_module)
                                          src/pdfquick/CMakeLists.txt:16 (qt_internal_add_qml_module)
                                        
                                        
                                        CMake Error at /home/slava/Qt/6.6.1/gcc_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:2355 (add_library):
                                          Target "PdfQuickplugin" links to target "XKB::XKB" but the target was not
                                          found.  Perhaps a find_package() call is missing for an IMPORTED target, or
                                          an ALIAS target is missing?
                                        Call Stack (most recent call first):
                                          /home/slava/Qt/6.6.1/gcc_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:2168 (_qt_internal_add_library)
                                          /home/slava/Qt/6.6.1/gcc_64/lib/cmake/Qt6/QtPluginHelpers.cmake:91 (qt6_add_plugin)
                                          /home/slava/Qt/6.6.1/gcc_64/lib/cmake/Qt6Qml/Qt6QmlBuildInternals.cmake:217 (qt_internal_add_plugin)
                                          src/pdfquick/CMakeLists.txt:16 (qt_internal_add_qml_module)
                                        
                                        
                                        -- Generating done
                                        CMake Generate step failed.  Build files cannot be regenerated correctly.
                                        CMake Error at /home/slava/Qt/6.6.1/gcc_64/lib/cmake/Qt6/QtProcessConfigureArgs.cmake:1040 (message):
                                          CMake exited with code 1.
                                        
                                        jsulmJ 1 Reply Last reply
                                        0
                                        • S slavaw

                                          @jsulm I think pictures are easier to understand, but if you insist:
                                          I reinstalled Emscripten, after install nodejs, flex, bison, gperf and now after execute (path ~/qtpdf/build):

                                          ~/Qt/6.6.1/gcc_64/bin/qt-configure-module ../qtwebengine -- -DFEATURE_qtwebengine_build=OFF
                                          
                                          

                                          QtPdf Module built succesfull, but CMake exited with error.
                                          45489d94-393f-4baa-9f7b-9ec157f2ca31-image.png

                                          Error:

                                          -- Configuring done
                                          CMake Error at /home/slava/Qt/6.6.1/gcc_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:2355 (add_library):
                                            Target "PdfWidgets" links to target "XKB::XKB" but the target was not
                                            found.  Perhaps a find_package() call is missing for an IMPORTED target, or
                                            an ALIAS target is missing?
                                          Call Stack (most recent call first):
                                            /home/slava/Qt/6.6.1/gcc_64/lib/cmake/Qt6/QtModuleHelpers.cmake:173 (_qt_internal_add_library)
                                            src/pdfwidgets/CMakeLists.txt:6 (qt_internal_add_module)
                                          
                                          
                                          CMake Error at /home/slava/Qt/6.6.1/gcc_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:2355 (add_library):
                                            Target "PdfQuick" links to target "XKB::XKB" but the target was not found.
                                            Perhaps a find_package() call is missing for an IMPORTED target, or an
                                            ALIAS target is missing?
                                          Call Stack (most recent call first):
                                            /home/slava/Qt/6.6.1/gcc_64/lib/cmake/Qt6/QtModuleHelpers.cmake:173 (_qt_internal_add_library)
                                            /home/slava/Qt/6.6.1/gcc_64/lib/cmake/Qt6Qml/Qt6QmlBuildInternals.cmake:164 (qt_internal_add_module)
                                            src/pdfquick/CMakeLists.txt:16 (qt_internal_add_qml_module)
                                          
                                          
                                          CMake Error at /home/slava/Qt/6.6.1/gcc_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:2355 (add_library):
                                            Target "PdfQuickplugin" links to target "XKB::XKB" but the target was not
                                            found.  Perhaps a find_package() call is missing for an IMPORTED target, or
                                            an ALIAS target is missing?
                                          Call Stack (most recent call first):
                                            /home/slava/Qt/6.6.1/gcc_64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:2168 (_qt_internal_add_library)
                                            /home/slava/Qt/6.6.1/gcc_64/lib/cmake/Qt6/QtPluginHelpers.cmake:91 (qt6_add_plugin)
                                            /home/slava/Qt/6.6.1/gcc_64/lib/cmake/Qt6Qml/Qt6QmlBuildInternals.cmake:217 (qt_internal_add_plugin)
                                            src/pdfquick/CMakeLists.txt:16 (qt_internal_add_qml_module)
                                          
                                          
                                          -- Generating done
                                          CMake Generate step failed.  Build files cannot be regenerated correctly.
                                          CMake Error at /home/slava/Qt/6.6.1/gcc_64/lib/cmake/Qt6/QtProcessConfigureArgs.cmake:1040 (message):
                                            CMake exited with code 1.
                                          
                                          jsulmJ Offline
                                          jsulmJ Offline
                                          jsulm
                                          Lifetime Qt Champion
                                          wrote on last edited by
                                          #21

                                          @slavaw said in How to build QtPdf?:

                                          but if you insist

                                          Well, I insist because it can be helpful for others to have it as text if they want to provide you modified versions (or test it on their own).

                                          Regarding the error you get now: make sure you installed libxcb-xkb1 and libxcb1-dev packages.

                                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved