-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
convert to pdf and png files is incorrect #360
Comments
Thank you for raising your first issue! Your help to improve svglib is much appreciated! |
The PNG renderer is known to be limited, see also #299. Could you tell us what make you think the PDF is not correct? |
I want to create a rotated bmw logo with svg, convert it to pdf, and send it to our chart supplier. it is used for camera quality test, so the accuracy is very import. |
here are files base on svg arcs(path) svg and pdf seems correct, but the png arcs are not very smooth, is there any setting for png generator? |
You may try the alternate PNG renderer as in #299 (comment). Anyway, there is nothing svglib can do to fix that, therefore closing. |
svglib==1.4.1 installed via pip.
Python 3.9.2
I use svglib and reportlab to convert svg to pdf and png
Files
SVG
PDF bmw logo.pdf
PNG
Code
from svglib.svglib import svg2rlg
from reportlab.graphics import renderPDF, renderPM
def svg2pdf(svg_path, path):
drawing = svg2rlg(svg_path)
renderPDF.drawToFile(drawing, path)
def svg2fmt(svg_path, path, fmt="PNG", dpi=75):
drawing = svg2rlg(svg_path)
renderPM.drawToFile(drawing, path, fmt=fmt, dpi=dpi)
the converted pdf and png is not correct, both of them are look different.
The text was updated successfully, but these errors were encountered: