Printer - One Record per page.
Hi friends,
Having a sqlite datafile (id,name,agreement) I wanted send to printer
the sorted names of all records, with yes at agreement, but each name at center
of 1 page, using only plain python and Qt. But Im lost to
figure how print each sqlite name field 1 per page in Qt.
Some gentle soul can post a simple snippet code of the process?
Anna->Eject A4 page->Cindy->Eject A4 page->Mary->Eject A4 page
Thanks in advance
7 replies
Hum… i converted the snippet to python but running it nothing happens…
(im away from printer now so choose to test it printing to pdf)
- from PyQt4.QtCore import *
- from PyQt4.QtGui import *
- from PyQt4.QtSql import *
- db.setDatabaseName("data.db")
- printer.setOutputFileName("test.pdf")
- start = painter.begin()
- while query.next():
- printer.drawText = QRectF((printer.width()-textSize.width)/2,(printer.height()-textSize.height())/2,textSize.width(),textSize.height())
- printer.newPage()
- painter.end()
shouldn’t it be
- printer.drawText(QRectF((printer.width()-textSize.width)/2,(printer.height()-textSize.height())/2,textSize.width(),textSize.height()))
You must log in to post a reply. Not a member yet? Register here!

