This commit is contained in:
Kovid Goyal 2012-12-31 16:41:19 +05:30
parent 9caf30fc1a
commit 32165539ea

View File

@ -98,12 +98,13 @@ def main():
tdir = gettempdir() tdir = gettempdir()
pdf = os.path.join(tdir, 'painter.pdf') pdf = os.path.join(tdir, 'painter.pdf')
func = brush func = brush
dpi = 100
with open(pdf, 'wb') as f: with open(pdf, 'wb') as f:
dev = PdfDevice(f, xdpi=100, ydpi=100, compress=False) dev = PdfDevice(f, xdpi=dpi, ydpi=dpi, compress=False)
img = QImage(dev.width(), dev.height(), img = QImage(dev.width(), dev.height(),
QImage.Format_ARGB32_Premultiplied) QImage.Format_ARGB32_Premultiplied)
img.setDotsPerMeterX(100*39.37) img.setDotsPerMeterX(dpi*39.37)
img.setDotsPerMeterY(100*39.37) img.setDotsPerMeterY(dpi*39.37)
img.fill(Qt.white) img.fill(Qt.white)
run(dev, func) run(dev, func)
run(img, func) run(img, func)