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. Working QPdfDocument class/module/etc...
Forum Updated to NodeBB v4.3 + New Features

Working QPdfDocument class/module/etc...

Scheduled Pinned Locked Moved Unsolved General and Desktop
33 Posts 8 Posters 6.3k Views 3 Watching
  • 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.
  • Chris KawaC Chris Kawa

    @RazerMind said:

    Your company is killing me

    It's not my company. I'm just a volunteer forum mod, I don't work for them ;)

    because to compile from scratch this module I obviously cannot

    Why not? It takes something like 5 minutes.

    R Offline
    R Offline
    RazerMind
    wrote on last edited by RazerMind
    #6

    @Chris-Kawa said in Working QPdfDocument class/module/etc...:

    It's not my company

    I know. these words are not for you directly. Sorry if you thought so. For that I fixed the wording...
    But of course for some guys from "there" - where for 1000% they will read it.

    1 Reply Last reply
    0
    • Chris KawaC Chris Kawa

      @RazerMind said:

      Your company is killing me

      It's not my company. I'm just a volunteer forum mod, I don't work for them ;)

      because to compile from scratch this module I obviously cannot

      Why not? It takes something like 5 minutes.

      R Offline
      R Offline
      RazerMind
      wrote on last edited by
      #7

      @Chris-Kawa said in Working QPdfDocument class/module/etc...:

      Why not? It takes something like 5 minutes.

      For example I can't use git. At all. Yes, don't ask me why.
      My comp is slow. It will not be 5 min for 10000000%

      Chris KawaC 1 Reply Last reply
      0
      • R RazerMind

        @Chris-Kawa said in Working QPdfDocument class/module/etc...:

        Why not? It takes something like 5 minutes.

        For example I can't use git. At all. Yes, don't ask me why.
        My comp is slow. It will not be 5 min for 10000000%

        Chris KawaC Offline
        Chris KawaC Offline
        Chris Kawa
        Lifetime Qt Champion
        wrote on last edited by
        #8

        @RazerMind You don't need git, you can download source code via the installer or a zip from the download page. QtPdf is a tiny module, maybe 20 files or so. Even a potato laptop from the 90's can build it pretty fast.

        R 1 Reply Last reply
        1
        • Chris KawaC Chris Kawa

          @RazerMind You don't need git, you can download source code via the installer or a zip from the download page. QtPdf is a tiny module, maybe 20 files or so. Even a potato laptop from the 90's can build it pretty fast.

          R Offline
          R Offline
          RazerMind
          wrote on last edited by RazerMind
          #9

          @Chris-Kawa said in Working QPdfDocument class/module/etc...:

          you can download source code via the installer or a zip from the download page.

          Stop maybe I do not understand at all - all these things. BUT I already have some folder named SRC
          after installation. SAs I said - exactly here I found all proper headers - which exist in fact. Exist but
          not in a proper places. And also in path \bin we have Qt5Pdf.dll and Qt5Pdfd.dll - inside these files
          I can trace the declaration and definition of QPdfDocument class and its functions.
          So It looks like all we have - so WHAT we should compile from sources??? Another version of this DLL?
          More powerful?

          Chris KawaC 1 Reply Last reply
          0
          • Chris KawaC Chris Kawa

            @RazerMind It's not a bug. There were some shenanigans about licensing of that module, you can look it up. Basically at some point Qt company tried to sell it via marketplace and removed it from the open source online installer. The module is still licensed under GPL and LGPL, so to get the binaries you'll have to build it yourself, as they are not distributed via the installer. This has seemingly been resolved for Qt6, where QtPdf is selectable as a separate module in the installer, but for Qt5 you'll have to build it yourself. There are some instructions on the Qt wiki: QtPDF Build Instructions

            As to Qt versions available:
            5.15.2 is the last open source LTS release in the Qt5 family, distributed with source and binaries via online installer.
            5.15.9 is the latest open source version in the Qt5 family, available only in source form. Not provided via open source online installer.
            5.15.13 is the latest commercial only version of Qt5.

            R Offline
            R Offline
            RazerMind
            wrote on last edited by RazerMind
            #10

            @Chris-Kawa said in Working QPdfDocument class/module/etc...:

            instructions on the Qt wiki: QtPDF Build Instructions

            say that I must call command with qmake:
            qmake ../qtwebengine -- -no-build-qtwebengine-core
            Of course - because we want to do that on Windows we must retranslate it properly:
            qmake.exe ..\qtwebengine.pro -- -no-build-qtwebengine-core
            And... qmake.exe was not found.... And that' right - because we use our version of build-scripts
            which properly set and tune all needed paths. Obviously that I can't reuse them for this case.
            So which qmake I should find/use? from \bin folder directly?

            1 Reply Last reply
            0
            • R RazerMind

              @Chris-Kawa said in Working QPdfDocument class/module/etc...:

              you can download source code via the installer or a zip from the download page.

              Stop maybe I do not understand at all - all these things. BUT I already have some folder named SRC
              after installation. SAs I said - exactly here I found all proper headers - which exist in fact. Exist but
              not in a proper places. And also in path \bin we have Qt5Pdf.dll and Qt5Pdfd.dll - inside these files
              I can trace the declaration and definition of QPdfDocument class and its functions.
              So It looks like all we have - so WHAT we should compile from sources??? Another version of this DLL?
              More powerful?

              Chris KawaC Offline
              Chris KawaC Offline
              Chris Kawa
              Lifetime Qt Champion
              wrote on last edited by Chris Kawa
              #11

              @RazerMind I'm not sure I understand you. If you have all the headers and dlls then the module is already built. What's the problem?
              To use a library on Windows you need a .lib file to link to at compile time, header file to include and a dll to link at runtime. If you already have these then you're good to go, no need to compile anything.

              R 1 Reply Last reply
              1
              • Chris KawaC Chris Kawa

                @RazerMind I'm not sure I understand you. If you have all the headers and dlls then the module is already built. What's the problem?
                To use a library on Windows you need a .lib file to link to at compile time, header file to include and a dll to link at runtime. If you already have these then you're good to go, no need to compile anything.

                R Offline
                R Offline
                RazerMind
                wrote on last edited by RazerMind
                #12

                @Chris-Kawa said in Working QPdfDocument class/module/etc...:

                What's the problem?

                VisualStudio says that there is NO header file <QPdfDocument>. And include QT+= pdf does not work.
                Also I do not understand your words about that "to get the binaries you'll have to build it yourself, as they are not distributed via the installer. " - IF that - what I found - is a real QPdfDocument - which I got from online installer - so why i have problems with code compilation and headers searching?

                It seems that under windows no one tests either the compile or the installing process. Even all wiki examples are written under the Linux console! It's just awful!
                It's just that it's likely that I found a bug in either the installer or the sources - which makes it impossible to use these classes.

                R 1 Reply Last reply
                0
                • R RazerMind

                  @Chris-Kawa said in Working QPdfDocument class/module/etc...:

                  What's the problem?

                  VisualStudio says that there is NO header file <QPdfDocument>. And include QT+= pdf does not work.
                  Also I do not understand your words about that "to get the binaries you'll have to build it yourself, as they are not distributed via the installer. " - IF that - what I found - is a real QPdfDocument - which I got from online installer - so why i have problems with code compilation and headers searching?

                  It seems that under windows no one tests either the compile or the installing process. Even all wiki examples are written under the Linux console! It's just awful!
                  It's just that it's likely that I found a bug in either the installer or the sources - which makes it impossible to use these classes.

                  R Offline
                  R Offline
                  RazerMind
                  wrote on last edited by RazerMind
                  #13

                  @RazerMind said in Working QPdfDocument class/module/etc...:

                  It seems that under windows no one tests either the compile or the installing process

                  I've got the proof. I was able finally to start mentioned in Wiki command
                  qmake.exe ..\qtwebengine.pro -- -no-build-qtwebengine-core
                  and I got absolutely different output - and not the same like mentioned in Wiki!
                  Tell me, please, how can I be guided by such instructions if they are not supported by exactly the same lines
                  in my windows console? Seeing such a discrepancy, I will not be 100% sure that I should continue the assembly at all.
                  How could they have written this?

                  R 1 Reply Last reply
                  0
                  • R RazerMind

                    @RazerMind said in Working QPdfDocument class/module/etc...:

                    It seems that under windows no one tests either the compile or the installing process

                    I've got the proof. I was able finally to start mentioned in Wiki command
                    qmake.exe ..\qtwebengine.pro -- -no-build-qtwebengine-core
                    and I got absolutely different output - and not the same like mentioned in Wiki!
                    Tell me, please, how can I be guided by such instructions if they are not supported by exactly the same lines
                    in my windows console? Seeing such a discrepancy, I will not be 100% sure that I should continue the assembly at all.
                    How could they have written this?

                    R Offline
                    R Offline
                    RazerMind
                    wrote on last edited by
                    #14

                    Yeah, I’m starting to lose track of what the online installer did and what I need to do.
                    After his actions - yes, there are files
                    Qt5Pdf.dll
                    Qt5Pdfd.dll
                    Qt5PdfWidgets.dll
                    Qt5PdfWidgetsd.dll
                    qpdf_p.h
                    Qt5Pdf.lib
                    Qt5Pdfd.lib
                    Qt5PdfWidgets.lib
                    Qt5PdfWidgetsd.lib
                    Qt5Pdf.pdb
                    Qt5Pdfd.pdb
                    Qt5PdfWidgets.pdb
                    Qt5PdfWidgetsd.pdb
                    qpdf.pdb
                    qpdfd.pdb
                    Qt5Pdf.prl
                    Qt5Pdfd.prl
                    Qt5PdfWidgets.prl
                    Qt5PdfWidgetsd.prl
                    within which there is clearly a realization of the class I require and its supporting elements.
                    But there are no correct files to include the header and Qt-module.
                    And to get them you need to run a compilation of everything inside the webengine module?

                    Chris KawaC 2 Replies Last reply
                    0
                    • R RazerMind

                      Yeah, I’m starting to lose track of what the online installer did and what I need to do.
                      After his actions - yes, there are files
                      Qt5Pdf.dll
                      Qt5Pdfd.dll
                      Qt5PdfWidgets.dll
                      Qt5PdfWidgetsd.dll
                      qpdf_p.h
                      Qt5Pdf.lib
                      Qt5Pdfd.lib
                      Qt5PdfWidgets.lib
                      Qt5PdfWidgetsd.lib
                      Qt5Pdf.pdb
                      Qt5Pdfd.pdb
                      Qt5PdfWidgets.pdb
                      Qt5PdfWidgetsd.pdb
                      qpdf.pdb
                      qpdfd.pdb
                      Qt5Pdf.prl
                      Qt5Pdfd.prl
                      Qt5PdfWidgets.prl
                      Qt5PdfWidgetsd.prl
                      within which there is clearly a realization of the class I require and its supporting elements.
                      But there are no correct files to include the header and Qt-module.
                      And to get them you need to run a compilation of everything inside the webengine module?

                      Chris KawaC Offline
                      Chris KawaC Offline
                      Chris Kawa
                      Lifetime Qt Champion
                      wrote on last edited by Chris Kawa
                      #15

                      @RazerMind Slow down. If you have these files you don't need to compile the module. It's already done. What's the path to Qt5Pdf.dll, Qt5Pdf.lib and QPdfDocument files?

                      I might have been wrong about them not being included in the installer. Like I said - there was a licensing issue a while back, but maybe it's been resolved for Qt5 too. I just didn't follow it that closely.

                      R 1 Reply Last reply
                      0
                      • Chris KawaC Chris Kawa

                        @RazerMind Slow down. If you have these files you don't need to compile the module. It's already done. What's the path to Qt5Pdf.dll, Qt5Pdf.lib and QPdfDocument files?

                        I might have been wrong about them not being included in the installer. Like I said - there was a licensing issue a while back, but maybe it's been resolved for Qt5 too. I just didn't follow it that closely.

                        R Offline
                        R Offline
                        RazerMind
                        wrote on last edited by RazerMind
                        #16

                        @Chris-Kawa said in Working QPdfDocument class/module/etc...:

                        Qt5Pdf.dll, Qt5Pdf.lib

                        I have as you may see. DLL and PDB files of course inside .\BIN folder. LIB - inside .\LIB
                        but there are no corresponding headers for QPdfDocument and it's sub-elements inside .\INCLUDE folder
                        And no corresponding files like:
                        qt_lib_pdf.pri
                        qt_lib_pdf_private.pri
                        qt_lib_pdfwidgets.pri
                        qt_lib_pdfwidgets_private.pri
                        qt_plugin_qpdf.pri
                        qt_plugin_qwebengineview.pri
                        inside .\mkspecs\modules folder.
                        Which create in fact the ability to be searchable Qt module for string inside *.pro file like:
                        QT += pdf

                        1 Reply Last reply
                        0
                        • R RazerMind

                          Yeah, I’m starting to lose track of what the online installer did and what I need to do.
                          After his actions - yes, there are files
                          Qt5Pdf.dll
                          Qt5Pdfd.dll
                          Qt5PdfWidgets.dll
                          Qt5PdfWidgetsd.dll
                          qpdf_p.h
                          Qt5Pdf.lib
                          Qt5Pdfd.lib
                          Qt5PdfWidgets.lib
                          Qt5PdfWidgetsd.lib
                          Qt5Pdf.pdb
                          Qt5Pdfd.pdb
                          Qt5PdfWidgets.pdb
                          Qt5PdfWidgetsd.pdb
                          qpdf.pdb
                          qpdfd.pdb
                          Qt5Pdf.prl
                          Qt5Pdfd.prl
                          Qt5PdfWidgets.prl
                          Qt5PdfWidgetsd.prl
                          within which there is clearly a realization of the class I require and its supporting elements.
                          But there are no correct files to include the header and Qt-module.
                          And to get them you need to run a compilation of everything inside the webengine module?

                          Chris KawaC Offline
                          Chris KawaC Offline
                          Chris Kawa
                          Lifetime Qt Champion
                          wrote on last edited by Chris Kawa
                          #17

                          Looking at it some more the issue might be ongoing after all. It's a bit of a mess, but not a technical one, more of a policy and marketing shambles. At some point QtPdf was removed from installer and available for purchase from the marketplace. But then it was removed from there, so now it's in some weird state where installer still distributes dlls as part of the QtWebEngine module, but does not include other files you mentioned. Depending on where you look it seems to be intentional.
                          I think the easiest might be to contact Qt Company directly to clear the status of that module, otherwise you'll have to rebuild QtWebEngine to get these files yourself.

                          R 1 Reply Last reply
                          0
                          • Chris KawaC Chris Kawa

                            Looking at it some more the issue might be ongoing after all. It's a bit of a mess, but not a technical one, more of a policy and marketing shambles. At some point QtPdf was removed from installer and available for purchase from the marketplace. But then it was removed from there, so now it's in some weird state where installer still distributes dlls as part of the QtWebEngine module, but does not include other files you mentioned. Depending on where you look it seems to be intentional.
                            I think the easiest might be to contact Qt Company directly to clear the status of that module, otherwise you'll have to rebuild QtWebEngine to get these files yourself.

                            R Offline
                            R Offline
                            RazerMind
                            wrote on last edited by RazerMind
                            #18

                            @Chris-Kawa
                            created https://bugreports.qt.io/browse/QTBUG-113125
                            Hope, it will be commented soon...

                            R 1 Reply Last reply
                            0
                            • R RazerMind

                              @Chris-Kawa
                              created https://bugreports.qt.io/browse/QTBUG-113125
                              Hope, it will be commented soon...

                              R Offline
                              R Offline
                              RazerMind
                              wrote on last edited by RazerMind
                              #19

                              Of course, it was my fault, I should have read the help DOCs more carefully...
                              But even developers had an unclear sense of humor when they created support for PDF files....
                              As it turned out - it is in fact as if there is no)))) You can not take and combine two PDF files.
                              You can't append new pdf file into existing one... The simplest operations are simply does not exist at all!
                              The QPdfDocument class does absolutely incomprehensible operations. Nothing useful...
                              It’s just horror and gloom...
                              I thought I’d do this job in half a day. And it’s already been two weeks since I just figured out that there’s nothing you can do that makes sense in these Qt* classes...
                              Why does python have default support for everything with pdf? And here after years there is nothing sensible! And even in the 6th branch nothing needed is created!

                              kkoehneK 1 Reply Last reply
                              0
                              • R RazerMind

                                Of course, it was my fault, I should have read the help DOCs more carefully...
                                But even developers had an unclear sense of humor when they created support for PDF files....
                                As it turned out - it is in fact as if there is no)))) You can not take and combine two PDF files.
                                You can't append new pdf file into existing one... The simplest operations are simply does not exist at all!
                                The QPdfDocument class does absolutely incomprehensible operations. Nothing useful...
                                It’s just horror and gloom...
                                I thought I’d do this job in half a day. And it’s already been two weeks since I just figured out that there’s nothing you can do that makes sense in these Qt* classes...
                                Why does python have default support for everything with pdf? And here after years there is nothing sensible! And even in the 6th branch nothing needed is created!

                                kkoehneK Offline
                                kkoehneK Offline
                                kkoehne
                                Moderators
                                wrote on last edited by
                                #20

                                @RazerMind , well, let me push back. The documentation starts with

                                The Qt PDF module contains classes and functions for rendering PDF documents.

                                https://doc.qt.io/qt-5/qtpdf-index.html. Rendering is the process of showing PDF, not writing a new PDF from scratch, or appending two PDF's.

                                But even developers had an unclear sense of humor when they created support for PDF files.

                                Well, rendering and printing PDF's is actually the most basic (and sought-after) operations for applications that deal with PDF's . Qt PDF actually just wraps the functionality in Chromium, which is also just about rendering. Printing PDF's is somethign that Qt generic printer framework supports.

                                I hear that you have a different use case, but don't blame the developers that they focussed on the top priority : Rendering PDF's, and generating them (by the way of printing).

                                Director R&D, The Qt Company

                                R 1 Reply Last reply
                                1
                                • kkoehneK kkoehne

                                  @RazerMind , well, let me push back. The documentation starts with

                                  The Qt PDF module contains classes and functions for rendering PDF documents.

                                  https://doc.qt.io/qt-5/qtpdf-index.html. Rendering is the process of showing PDF, not writing a new PDF from scratch, or appending two PDF's.

                                  But even developers had an unclear sense of humor when they created support for PDF files.

                                  Well, rendering and printing PDF's is actually the most basic (and sought-after) operations for applications that deal with PDF's . Qt PDF actually just wraps the functionality in Chromium, which is also just about rendering. Printing PDF's is somethign that Qt generic printer framework supports.

                                  I hear that you have a different use case, but don't blame the developers that they focussed on the top priority : Rendering PDF's, and generating them (by the way of printing).

                                  R Offline
                                  R Offline
                                  RazerMind
                                  wrote on last edited by RazerMind
                                  #21

                                  @kkoehne said in Working QPdfDocument class/module/etc...:

                                  Rendering PDF's, and generating them

                                  I would agree if it would sound like "Rendering PDF's, and generating them al least with 2 options - or printing or cat'ing/appending".
                                  I can't really imagine situations where printing had THIS HUGE influence over concatenating to one file of many/adding one to the tail of another PDF file. Yes, all other possible operations that are performed by specialized software systems sharpened for this - yes, these are already very serious things that should not be left within the framework of this library.
                                  But there is ONLY ONE rendering/printing. It's horrible...

                                  D 1 Reply Last reply
                                  0
                                  • R RazerMind

                                    @kkoehne said in Working QPdfDocument class/module/etc...:

                                    Rendering PDF's, and generating them

                                    I would agree if it would sound like "Rendering PDF's, and generating them al least with 2 options - or printing or cat'ing/appending".
                                    I can't really imagine situations where printing had THIS HUGE influence over concatenating to one file of many/adding one to the tail of another PDF file. Yes, all other possible operations that are performed by specialized software systems sharpened for this - yes, these are already very serious things that should not be left within the framework of this library.
                                    But there is ONLY ONE rendering/printing. It's horrible...

                                    D Offline
                                    D Offline
                                    DerReisende
                                    wrote on last edited by
                                    #22

                                    @RazerMind If you need to concat pdf files and do other modifications to them it might be better to use the podofo framework for it. It does work on windows as well.

                                    R 1 Reply Last reply
                                    0
                                    • D DerReisende

                                      @RazerMind If you need to concat pdf files and do other modifications to them it might be better to use the podofo framework for it. It does work on windows as well.

                                      R Offline
                                      R Offline
                                      RazerMind
                                      wrote on last edited by
                                      #23

                                      @DerReisende ouch, of course NOW i understand that I can't do anything really mature with help of Qt-based modules/classes. And thus I have to search any small/easy compiling open-source project which can do this trick...
                                      OR ask guys who can easily write code on python - to help me - to create a script which can do this job easily... And so I will just call it in async thread.
                                      But this is very inconvenient and strange when, figuratively speaking, I have a huge mountain-library under my feet, in which there is everything and even more, but this smallness is not at all.

                                      JonBJ D 2 Replies Last reply
                                      0
                                      • R RazerMind

                                        @DerReisende ouch, of course NOW i understand that I can't do anything really mature with help of Qt-based modules/classes. And thus I have to search any small/easy compiling open-source project which can do this trick...
                                        OR ask guys who can easily write code on python - to help me - to create a script which can do this job easily... And so I will just call it in async thread.
                                        But this is very inconvenient and strange when, figuratively speaking, I have a huge mountain-library under my feet, in which there is everything and even more, but this smallness is not at all.

                                        JonBJ Offline
                                        JonBJ Offline
                                        JonB
                                        wrote on last edited by
                                        #24

                                        @RazerMind
                                        It won't help much with your disappointment with Qt, but if you might wish to interoperate with Python programmers for the integration benefits that offers, maybe you should consider using PySide and program for Qt in Python rather than C++?

                                        R 1 Reply Last reply
                                        0
                                        • JonBJ JonB

                                          @RazerMind
                                          It won't help much with your disappointment with Qt, but if you might wish to interoperate with Python programmers for the integration benefits that offers, maybe you should consider using PySide and program for Qt in Python rather than C++?

                                          R Offline
                                          R Offline
                                          RazerMind
                                          wrote on last edited by RazerMind
                                          #25

                                          @JonB said in Working QPdfDocument class/module/etc...:

                                          maybe you should consider using PySide and program for Qt in Python rather than C++?

                                          Definitely no. I use only C++. Python will be used as standalone exe - file script interpretation tool. only.

                                          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