Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
5.0.1
-
None
-
It happen both on Linux and Windows
Description
When use QPrintPreviewDialog it shows wrongly painted webpage content (wrong layouts, buttons without text, page cutted and so one), the problem is somethere related to QPicture pages in QPrinter. Try to print almost any page webpage (for example wikipedia) to see the problem (or see attachment).
I found a way to fix this, but on qtwebkit side, by making QPicture for each page and draw it in QPrinter painter then. The following changes in QtWebkit code (qwebframe.cpp) fixes that wrong printing:
@@ -879,7 +881,17 @@
printer->printerState() == QPrinter::Error)
{
return;
}
|
QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform | QPainter::HighQualityAntialiasing); + pagePainter.scale(zoomFactorX, zoomFactorY); + QtPrintContext pagePrintContext(&pagePainter, pageRect, d); + pagePrintContext.spoolPage(page - 1, pageRect.width()); + pagePainter.end(); + painter.drawPicture(0, 0, pagePicture); + if (j < pageCopies - 1) printer->newPage(); } |
---|
Attachments
Issue Links
- is replaced by
-
QTBUG-30621 Text is cut off at the right margin when printing from QWebView
- Closed