Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
4.8.0
-
None
-
Windows 7 + Visual Studio 2010
Description
Hi.
I have been trying to print to pdf with incorrect results.
Expected behavior
Using the combination of a PdfFormat on a QPrinter, a linear gradient and a scale to draw a rectangle (NoPen) should draw a gradient only, using the right colors.
What happens
Without anti-aliasing, lines appear on the top and left corners of the rectangle.
Activating anti-aliasing seems to fix the lines problem but creates a new one where colors becomes dirty in adobe reader (but fine with any other pdf reader). I suspect to bug to be linked to the first one, but may be a separate one.
Minimal code reproducing the problem
(try false/true for setRenderHints(QPainter::Antialiasing, ...) to get different results)
#include <QPainter> #include <QPrinter> #include <QtCore/QCoreApplication> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QPrinter* printer = new QPrinter(); printer->setOutputFileName("print.pdf"); printer->setOutputFormat(QPrinter::PdfFormat); QPainter painter(printer); painter.setRenderHints(QPainter::Antialiasing, false); painter.setPen(Qt::NoPen); QLinearGradient grad(0.0f, 0.0f, 0.0f, 90.0f); grad.setColorAt(0.0f, Qt::blue); grad.setColorAt(1.0f, Qt::white); painter.setBrush(grad); painter.scale(1.337, 1.337); painter.drawRect(QRect(10, 10, 100, 100)); painter.end(); return 0; }
Attachment
Screenshot showing on the:
- left-top: Adobe Reader with Antialiasing to false
- left-right: Adobe Reader with Antialiasing to true
- bottom: Foxit Reader with Antialiasing to true
Lines still appear on Foxit Reader with Antialiasing to false.
Attachments
Issue Links
- is required for
-
QTBUG-25379 QtPrintSupport - PDF Issues
- Open
-
QTBUG-37693 QtPrintSupport - Painting Issues
- Open
-
QTBUG-37713 QtPrintSupport - 5.3 issues
- Open