Answer the question
In order to leave comments, you need to log in
Library for rendering SVG to PNG?
Task: Render an SVG file to PNG (desirable).
It so happened that SVG is built by a Javascript application on the client side. There is a whole complex of construction schemes. The result is a file that opens correctly with GIMP (Inkscape doesn't handle "use" tags).
We need a command/procedure/library that receives an SVG file as an input, and a PNG (or BinaryStream) as an output, for embedding into the ASP.NET (Win32) WEB server.
Attempts to include Cairo, gtk (mono), GIMP API - failed :(
PS: Wouldn't want to use Mono. Performance doesn't really matter. Don't offer *nix tools.
Answer the question
In order to leave comments, you need to log in
In: code.google.com/p/canvg/
SVG → Canvas
And then you'll figure it out :)
Converted svg to png in batch using Inkscape, you can use it on the console:
# -*- coding: utf-8 -*-
import os
path=".\\"
dirList=os.listdir(path)
for fname in dirList:
try:
if fname[-4:] == ".svg":
print fname
os.system('''"C:\Program Files (x86)\Inkscape\inkscape.exe" -z -e %s.png -w 256 -h 256 %s'''%(fname,fname))
except:
pass
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question