Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
None
-
5.15.10, 6.3.1
Description
When a very simple shape with basic linear gradient is rendered to a PDF file with QPdfWriter-based QPainter, resulting file is not rendered by macOS standard Preview app. When opened in the latest Adobe Illustrator, it reports "An unknown shading type was encountered.", but then opens the file correctly.
Here's the code.
QPdfWriter pdf("qtbug106790.pdf");
pdf.setResolution(72);
pdf.setPageMargins(QMarginsF(10, 10, 10, 10));
pdf.setPageSize(QPageSize(QSize(1000, 1000)));
QPainter painter(&pdf);
QLinearGradient grad(0, 0, 0, 1000);
grad.setColorAt(0, Qt::white);
grad.setColorAt(1, Qt::black);
painter.fillRect(100, 100, 800, 800, grad);
The file can be opened correctly with other tools such as Adobe Acrobat Reader or Chrome
Sample project attached ( qtbug106790.zip )
Attachments
Issue Links
- duplicates
-
QTBUG-94200 Gradients don't render as expected when writing to PDF
-
- Reported
-