svglib icon indicating copy to clipboard operation
svglib copied to clipboard

svg convert to pdf with gray images

Open hbh112233abc opened this issue 4 years ago • 4 comments

svg image temp1629451352.8199928.svg.zip convert to pdf temp1629451352.8199928.pdf

env: win10 64bit python 3.7 64bit svglib 1.0.1

demo:

from svglib.svglib import svg2rlg
from reportlab.graphics import renderPDF

svg_file = 'temp1629451352.8199928.svg'
pdf_file = 'temp1629451352.8199928.pdf'

drawing = svg2rlg(svg_file)
renderPDF.drawToFile(drawing, pdf_file)

error display 微信截图_20210823115413

And I use cairosvg convert pdf not found this problem!

hbh112233abc avatar Aug 23 '21 03:08 hbh112233abc

You don't provide much information except for the files. But I assume you don't expect the upper left black labels to be where they are, and I guess they are a copy of the lower right red ones. Can you strip down the SVG to a minimal size that shows this effect, please?

deeplook avatar Aug 25 '21 08:08 deeplook

Opening it in Firefox gives

bildo

So I think that's the expected output

marie-bnl avatar Aug 26 '21 18:08 marie-bnl

Opening it in Firefox gives

bildo

So I think that's the expected output

the problem is the output pdf file has error! the svg image not found error!

hbh112233abc avatar Aug 30 '21 03:08 hbh112233abc

@hbh112233abc You can help debugging by minimizing your SVG to a version that shows the undesired effect.

deeplook avatar Aug 30 '21 07:08 deeplook

I tried with most recent svglib version and the output looks a lot nicer now.

claudep avatar Aug 20 '22 09:08 claudep