[PyQt] Printing QGraphicsScene on printer or pdf file format.

Aleksandar Nedeljkovic sasko2909 at gmail.com
Sat Jul 18 06:08:32 BST 2015


Hi,

I made an application that uses QGraphicsScene to show some reports. After
that I use QGraphicsScene.render() and QPainter to print content of
QGraphicsScene to printer or pdf file.

And I got confused, because on Centos 6 it all works fine, but on Windows 7
letters are not positioned nicely, different from the contents of
QGraphicsScene.

I made some small test script (in attachment) that does described work.
There is also result of printing of content of QGraphicsScene in pdf file
in Centos 6 (good) and Windows 7 (not good).

Can anybody tell me what I am doing wrong, or is this some problem specific
for Windows. And is there anything that I can do to fix this.

Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150718/e6d69735/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Report20150718Centos6.pdf
Type: application/pdf
Size: 6623 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150718/e6d69735/attachment-0002.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Report20150718Windows7.pdf
Type: application/pdf
Size: 7642 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150718/e6d69735/attachment-0003.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testreport.py
Type: text/x-python
Size: 10428 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150718/e6d69735/attachment-0001.py>


More information about the PyQt mailing list