Working QPdfDocument class/module/etc...
-
wrote on 23 Apr 2023, 13:08 last edited by
Hi all and please advise and explant to me - WHICH exactly version of Qt lib and from where I should download -
as precompiled variant of MSVC2019 32bit - so I could get Working QPdfDocument class/module/etc...?
I thought that latest available LTS release 5.15.2 will be the answer. but...
folder \include does not contains such file. But DOCs are saying that:
Header: #include <QPdfDocument>
Since: Qt 5.10BTW- why 5.15.2 is declared as LTS but I already saw 5.15.13 ver. in Internet....
but download section from https://download.qt.io/official_releases/qt/5.15/ contains only 5.15.9 as the latest src.... -
wrote on 23 Apr 2023, 13:36 last edited by RazerMind
Uauuu, I found in path ...\5.15.2\Src\qtwebengine\include\ desirable headers in form of pre-declaraded and ready-to-use high level H-folders and they internal h-files: \QtPdf and \QtPdfWidgets. Just like the ones next to it: QtWebEngine, QtWebEngineCore\ and QtWebEngineWidgets\ - which in they turn WERE copied into path ...\5.15.2\msvc2019\include\ -into the general vault of all library headers. But for some reasons online installer did not copy \QtPdf and \QtPdfWidgets. Unbelievable
But simply copy-paste I can't do by myself, because each internal folder 'private' contains special .....-config_p.h file with some special content inside it. Which I for obvious reasons can NOT repeat easily for \QtPdf and \QtPdfWidgets - for their corresponding internal 'private' folders...
super BUG? for LTS release??? -
Uauuu, I found in path ...\5.15.2\Src\qtwebengine\include\ desirable headers in form of pre-declaraded and ready-to-use high level H-folders and they internal h-files: \QtPdf and \QtPdfWidgets. Just like the ones next to it: QtWebEngine, QtWebEngineCore\ and QtWebEngineWidgets\ - which in they turn WERE copied into path ...\5.15.2\msvc2019\include\ -into the general vault of all library headers. But for some reasons online installer did not copy \QtPdf and \QtPdfWidgets. Unbelievable
But simply copy-paste I can't do by myself, because each internal folder 'private' contains special .....-config_p.h file with some special content inside it. Which I for obvious reasons can NOT repeat easily for \QtPdf and \QtPdfWidgets - for their corresponding internal 'private' folders...
super BUG? for LTS release???@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. -
@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.wrote on 23 Apr 2023, 13:51 last edited by RazerMind@Chris-Kawa said in Working QPdfDocument class/module/etc...:
you'll have to build it yourself
This company is killing me . Really. I already spent more than a week in order to understand that I can't use Qt 6 branch. At all.
Because I must use 32 bit apps. And NOW you ruined my life literally - because to compile from scratch this module I obviously cannot ... It’s the 21st century, but for nonsense reasons we have a huge problem getting someone to sign a license right. -
@Chris-Kawa said in Working QPdfDocument class/module/etc...:
you'll have to build it yourself
This company is killing me . Really. I already spent more than a week in order to understand that I can't use Qt 6 branch. At all.
Because I must use 32 bit apps. And NOW you ruined my life literally - because to compile from scratch this module I obviously cannot ... It’s the 21st century, but for nonsense reasons we have a huge problem getting someone to sign a license right.@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.
-
@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.
wrote on 23 Apr 2023, 13:54 last edited by RazerMind@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. -
@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.
wrote on 23 Apr 2023, 13:56 last edited by@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-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%@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.
-
@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.
wrote on 23 Apr 2023, 14:10 last edited by 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? -
@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.wrote on 23 Apr 2023, 14:18 last edited by RazerMind@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? -
@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?@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. -
@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.wrote on 23 Apr 2023, 14:24 last edited by 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. -
@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.wrote on 23 Apr 2023, 14:32 last edited by 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? -
@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?wrote on 23 Apr 2023, 14:43 last edited byYeah, 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? -
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?@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.
-
@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.
wrote on 23 Apr 2023, 15:03 last edited by RazerMind@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 -
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?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. -
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.wrote on 23 Apr 2023, 18:39 last edited by RazerMind@Chris-Kawa
created https://bugreports.qt.io/browse/QTBUG-113125
Hope, it will be commented soon... -
@Chris-Kawa
created https://bugreports.qt.io/browse/QTBUG-113125
Hope, it will be commented soon...wrote on 24 Apr 2023, 09:57 last edited by RazerMindOf 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! -
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!@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).
1/33