Closed ahmad88me closed 2 years ago
Thank you for raising your first issue! Your help to improve svglib is much appreciated!
The source code used:
drawing = svg2rlg(src_file)
if output_format.lower() == "pdf":
renderPDF.drawToFile(drawing, dest_file)
elif output_format.lower() == "eps":
renderPS.drawToFile(drawing, dest_file)
I'm afraid this may be a ReportLab issue (as the PDF looks OK). @replabrobin, any idea about what could explain such a difference?
It looks like a font issue. I cannot debug without the right svg, but when I view it in chrome I just see a black rectangle. I assume it must be right so I I will attempt the conversions.
OK the original svg has a problem somewhere. I tested various output formats including png, pdf, eps, py only pdf showed the text. If I generate svg using eg --outdir=../ --formats=svg then 1) the generated svg can be seen properly in chrome and 2) most of the outputs converted from it show the text. Interestingly eps still doesn't.
This example has too many bits to debug properly. Everythiing in it is just curves so it can't be a font issue, but it might be opacity/colour handling etc etc.
This SVG is generated using pandas (and seaborn). I have several different SVG files generated in the same way all having the same issue. (just in case this info helps).
I'm afraid that svglib is not able to impact the issue with EPS rendering, sorry.
Converting the SVG to the EPS loses the legend and the numbers on the axis. But that does not happen when converting the same SVG to PDF.
SVG:
Screenshot: (left is the PDF version and the right one is the EPS version)