Created attachment 105047 [details] pdf after printing from Konqueror with WebEngine Printing to pdf file from Konqueror or KMail produces pdf file that doesn't have any searchable text - there's no fonts embedded and everything looks quite ugly (see attached print.pdf). I installed cups-pdf, and the result is the same. But when I print to pdf file from GTK apps like firefox or thunderbird, I get normal pdf with selectable text and embedded fonts. The properties of the resulting files show that the producer of the file is Qt 5.8.0 for KDE-generated ones and cairo 1.9.5 for GTK-generated. If I change the web engine in Konqueror from WebEngine to KHTML, there's another problem (images won't load), but the resulting pdf file is a good one.
Created attachment 105048 [details] pdf file created with KHTML engine
I can confirm this bug. It still exists in Fedora 28 with the latest updates. - konqueror-18.04.3-1.fc28.x86_64 - kmail-18.04.3-1.fc28.x86_64 When I set the rendering engine to KHTML or Wegkit the result of the PDF-File seems to be OK, but set to Webengine the output doesn't have any text or embedded fonts. There is no option for Kmail to set the rendering engine, so the PDF-File doesn't have any text or embedded fonts. The quality of the PDF-File is very poor.
Confirming. KMail 19.04.3 on Gentoo, with KDE Frameworks 5.60
I can confirm on Fedora 30 KDE Plasma Version: 5.15.5 KDE Frameworks Version: 5.59.0 Qt Version: 5.12.4
It still is the same in the current Arch: plasma-desktop 5.16.4-1 plasma-framework 5.61.0-1 qt5-webengine 5.13.0-4
Hi, it's been now more the two years since this bug has been reported and the bug still exists. I am wondering why we don't receive any answer. On one hand the developers encourage us user to report bugs and on the other hand they don't reply. I respect it if there is no maintainer for this project, but please reply and say yes, no, maybe or tell us that there is no developer yet. I hope you guys don't mind it if I say my opinion, even if this is a wrong place for, but two years without any answer is definitely too much time. And again: it affects KMail as well.
If this is reproducible with Qt 5.13 or newer, please report this issue directly to QtWebEngine developers via https://bugreports.qt.io/
Thanks for your reply. Unfortunately Qt 5.13 is not available on Fedora 30 but hopefully on Fedora 31. I will give it a try then and if it still doesn't work, I will report it to QtWebEngine developers.
I have just tested on KDE Neon (Qt 5.13.1). It is reproducible. I have reported the issue to QtWebEngine developers. https://bugreports.qt.io/browse/QTBUG-79527 Perhaps someone should change here the status to "reopened" or "verified" because the issue is definitely not resolved.
(In reply to Christoph Feck from comment #7) > If this is reproducible with Qt 5.13 or newer, please report this issue > directly to QtWebEngine developers via https://bugreports.qt.io/ Could you please take a look at "https://bugreports.qt.io/browse/QTBUG-79527". They say that this "https://doc.qt.io/qt-5/qwebenginepage.html#printToPdf" should be used to generate searchable pdf files.
Printing to PDF with QtWebEngine must use printToPdf, not print. See the code in Falkon: https://invent.kde.org/network/falkon/-/blob/ba4f18478141e3909770b3b2cf59903166dd34cc/src/lib/webengine/webview.cpp#L402 The print method is a hack which prints to a temporary PDF, rasterizes the PDF with the bundled PDFium (!) and then sends the raster output to the QPainter (because there is unfortunately no code in Qt to render a PDF to a QPainter without rasterizing it). When the goal is to print to a PDF, this creates a bitmap blob wrapped in a PDF instead of a normal PDF. The way to work around that issue is to use printToPdf, which keeps the initial PDF and does no further processing to it. Konqueror's KWebEnginePart just always uses print: https://invent.kde.org/network/konqueror/-/blob/df3f50f10ad82921f54d2937e278d65e1e7ed2b4/webenginepart/src/webenginepart_ext.cpp#L281 And so does KMail: https://invent.kde.org/pim/messagelib/-/blob/9caf5ef74e0e85aa371984b3bb8b447f6ca7ff6a/messageviewer/src/viewer/viewer_p.cpp#L2376
I can confirm that printing to pdf from Falkon works as it supposed to. Meanwhile, the problem for konqueror and kmail is still there: plasma-desktop 5.20.3-1 plasma-framework 5.76.0-1 qt5-webengine 5.15.1-3 konqueror 20.08.3-1 kmail 20.08.3-1
KMail should be fixed by: https://invent.kde.org/pim/messagelib/commit/9538a30356896ea0c0ee80dfd2f0899f33be5cc0 (see bug #422095).
(Please note that the referenced KMail commit was authored and pushed yesterday and has not yet made it out to any release.)