mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
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:
parent
4d0bd49fb1
commit
dbbdc0a876
@ -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
|
||||
|
@ -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()
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user