deeplook / svglib

Read SVG files and convert them to other formats.
GNU Lesser General Public License v3.0
322 stars 79 forks source link

Spines (borders) are not converted #245

Closed nettlef closed 4 years ago

nettlef commented 4 years ago

When spines (borders) of matplotlib graph are set to not visible or different colour, this is not transformed correctly by svg2rlg.

deeplook commented 4 years ago

Please provide some code.

nettlef commented 4 years ago

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

rlg = svg2rlg("test.svg") c = canvas.Canvas("example.pdf") c.setTitle("my_title_we_dont_care") renderPDF.draw(rlg, c, 80, 740 - rlg.height,showBoundary=False) c.showPage() c.save()

At this moment I solved the issue by editing the svg produced by matplotlib (removing the defs part at the end)... But when I remove this part, there are then links inside the svg that are inconsistent. test.zip

claudep commented 4 years ago

Could you please add more details on what exactly is not looking right, maybe with screenshots? Can you confirm that you are using svglib 1.0.0 ?

deeplook commented 4 years ago

BTW, this text is shown when creating a new issue:

deeplook commented 4 years ago

BTW, this text is shown when creating a new issue...

""" When submitting a new issue please try to be as concise and precise as possible. This means to show only minimal SVG or PDF files that show something unexpected.

In times of widely available files infected with malicious code on the net, it is also appreciated to better include bitmap snapshots of your PDFs inside an issue.

Otherwise please provide information where relevant like specific versions of components in your setup, e.g. OS, Python, reportlab, svglib, type of install or anything else. """

claudep commented 4 years ago

Please reopen as soon as you can provide us some more details.