Move to QWebEngine (Qt 5.6) to print a PDF file
-
Hi,
I'm currently working to move a piece of code from Qt 4.8.4. to Qt 5.6. We selected Qt 5.6 because it is a long-term version. For our domain it is a critical requirement. And we are using Visual Studio 2013.This piece of code uses a QWebPage to create a complex HTML document with images inside. Then this document is printed in PDF format by using QWebPage->mainFrame()->print().
As WebKit has disappeared from official delivery, I'm trying to move to QWebEngine. But QWebEnginePage does not seem to have print functionality in Qt 5.6.
So, how to print a complex HTML document (with images) in PDF with Qt 5.6?
Thanks for your help.
-
Hi, have you tried QTextDocument?
-
@artwaw Hi, I remember we had a lot of trouble with QTextDocument in 4.8.4. So I did several tries with 5.6. And we still have troubles, particularly with the CSS. SO iti is why we moved to WebPage that really gave good results in term of page format.
-
Hi,
Just a quick recommandation, Qt 5.9 is the new LTS release so it might be well worth taking a shot at it. There's also @Konstantin-Tokarev QtWebKit reboot that might be of interest and could also simplify your life.
-
@SGaist Hi, I'm just trying Qt5.9. The only thing is that we will have to move to a more recent Visual studio version. As it seems that QtWebEngine does not exist for Visual 2013. And I also have some troubles moving to QtWebEngine (I will write another post for this).
-
The compiler depends on what the Chromium project supports.
As stated before, the QtWebkit reboot might a solution.
-
@SGaist said in Move to QWebEngine (Qt 5.6) to print a PDF file:
As stated before, the QtWebkit reboot might a solution.
We don't support VS2013 in 5.212.x. The only solution is to use legacy QtWebKit provided with Qt 5.9 in source form