PDF Output: Fix regression that caused some svg images to be rendered as black rectangles. Fixes #1105294 (conversion error svg -> kdp _> pdf)

This commit is contained in:
Kovid Goyal 2013-01-26 11:17:10 +05:30
parent 4d0bd49fb1
commit dbbdc0a876
3 changed files with 3 additions and 2 deletions

View File

@ -108,6 +108,7 @@ class PdfEngine(QPaintEngine):
def init_page(self):
self.pdf.transform(self.pdf_system)
self.pdf.apply_fill(color=(1, 1, 1)) # QPainter has a default background brush of white
self.graphics.reset()
self.pdf.save_stack()
self.current_page_inited = True

View File

@ -252,7 +252,7 @@ class GraphicsState(object):
'clip_updated', 'do_fill', 'do_stroke')
def __init__(self):
self.fill = QBrush()
self.fill = QBrush(Qt.white)
self.stroke = QPen()
self.opacity = 1.0
self.transform = QTransform()

View File

@ -113,7 +113,7 @@ def main():
app
tdir = os.path.abspath('.')
pdf = os.path.join(tdir, 'painter.pdf')
func = brush
func = full
dpi = 100
with open(pdf, 'wb') as f:
dev = PdfDevice(f, xdpi=dpi, ydpi=dpi, compress=False)