Summary: | Bad printout quality of kmail | ||
---|---|---|---|
Product: | [Applications] kmail2 | Reporter: | Gerhard <gstengel> |
Component: | misc | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | REPORTED --- | ||
Severity: | normal | CC: | arrigo.gosparini, axel.braun, bugs.kde.attila, bugs.kde.org, dag, kevin.kofler, kubry |
Priority: | NOR | ||
Version: | 5.14.1 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Gerhard
2020-05-26 11:44:09 UTC
This is due to how the QtWebEngine print method work. At least for PDF output, this can be easily fixed by using the printToPdf method instead, as done in Falkon. Please see https://bugs.kde.org/show_bug.cgi?id=378843 and in particular https://bugs.kde.org/show_bug.cgi?id=378843#c11 . For output to a physical printer, the only way to avoid the rasterization is to use the FilePrinter class from Okular though. Falkon used to do that (I had submitted that code back when the QtWebEngine did not have the print method at all, only printToPdf), but switched to using the print method for physical printers. Git commit 9538a30356896ea0c0ee80dfd2f0899f33be5cc0 by Laurent Montel. Committed on 17/11/2020 at 07:11. Pushed by mlaurent into branch 'release/20.12'. Start to fix print to pdf M +17 -1 messageviewer/src/viewer/viewer_p.cpp M +2 -1 messageviewer/src/viewer/viewer_p.h https://invent.kde.org/pim/messagelib/commit/9538a30356896ea0c0ee80dfd2f0899f33be5cc0 Git commit 5b85cf609f37a6a6fcd4add5bb1b3b6aaf75f0ef by Laurent Montel. Committed on 17/11/2020 at 07:13. Pushed by mlaurent into branch 'master'. Start to fix print to pdf M +17 -1 messageviewer/src/viewer/viewer_p.cpp M +2 -1 messageviewer/src/viewer/viewer_p.h https://invent.kde.org/pim/messagelib/commit/5b85cf609f37a6a6fcd4add5bb1b3b6aaf75f0ef Hi, printing to PDF file is OK. The PDF file has real "text" and fonts are embedded. This has been fixed. Printing to a real printer produces blurred text. The quality is very poor and the text is not easy to read. Can someone please take a look at this. KMail Version 5.19.2 (21.12.2). Operating System: Fedora Linux 35 KDE Plasma Version: 5.24.4 KDE Frameworks Version: 5.91.0 Qt Version: 5.15.2 Kernel Version: 5.17.11-200.fc35.x86_64 (64-bit) Graphics Platform: X11 Printing to a real printer still sends a bitmap to the printer. As I wrote:
> For output to a physical printer, the only way to avoid the rasterization is to use the FilePrinter class from Okular though. Falkon used to do that (I had submitted that code back when the QtWebEngine did not have the print method at all, only printToPdf), but switched to using the print method for physical printers.
What QtWebEngine cannot do is print directly to a QPrinter. The Chromium code can only output PDFs. Then you have to get that PDF to the printer somehow. How QtWebEngine does it is that it renders the PDF to a pixmap using the PDFium library that happens to be bundled with Chromium and then sends that pixmap to the printer. How Okular prints PDFs (and how Falkon used to do it at the beginning) is that it runs the lpr CLI command to send the PDF to the printer. The main difficulty with that is that you have to translate settings such as margins or page orientation or they will just get ignored, and that it also only works with printers that lpr knows about (e.g., you cannot print to PDF with that approach).
(In reply to Kevin Kofler from comment #5) > Printing to a real printer still sends a bitmap to the printer. As I wrote: > > > For output to a physical printer, the only way to avoid the rasterization is to use the FilePrinter class from Okular though. Falkon used to do that (I had submitted that code back when the QtWebEngine did not have the print method at all, only printToPdf), but switched to using the print method for physical printers. > > What QtWebEngine cannot do is print directly to a QPrinter. The Chromium > code can only output PDFs. Then you have to get that PDF to the printer > somehow. How QtWebEngine does it is that it renders the PDF to a pixmap > using the PDFium library that happens to be bundled with Chromium and then > sends that pixmap to the printer. How Okular prints PDFs (and how Falkon > used to do it at the beginning) is that it runs the lpr CLI command to send > the PDF to the printer. The main difficulty with that is that you have to > translate settings such as margins or page orientation or they will just get > ignored, and that it also only works with printers that lpr knows about > (e.g., you cannot print to PDF with that approach). Hi, thank you for the explanation from the developer's point of view. This is from the user's point of view not satisfying. The printout of e-mails with embedded messages is even worse. The output is very blurred and almost not readable. I think nothing is impossible in the world of IT, so there must be a solution for this issue. My workaround is to export e-mails to PDF, open them with Okular and print them. This is not really cool. It is a bad user experience. Please try to find a way to bring the print functionality back with no rasterization. The default print quality is so bad, that it would be better to only offer export/print to pdf (allowing for margin setting) and drop the current print result. Perhaps there is some opendesktop standard for opening files with their default application and open the print dialog? At least give the option to export an e-mail to pdf ("export to pdf...") and instead of saving to hd open the e-mail directly in Okular. This would be an acceptable workaround. |