I was just playing with the Ruby svg-graph library, and it seems to work
well.
I was wondering what tools people use to convert svg files into images?
Or is there a way to convert the generated file into an image using
svg-graph itself? Let’s assume my users don’t have a plugin to view svg
files directly in a web browser.
The main platform is Linux, but Solaris and Windows would be nice, too.
I was just playing with the Ruby svg-graph library, and it seems to work
well.
I was wondering what tools people use to convert svg files into images?
Or is there a way to convert the generated file into an image using
svg-graph itself? Let’s assume my users don’t have a plugin to view svg
files directly in a web browser.
You can try convert, from ImageMagick. Basically convert anything to
nearly anything…
I was just playing with the Ruby svg-graph library, and it seems to work
well.
I was wondering what tools people use to convert svg files into images?
Or is there a way to convert the generated file into an image using
svg-graph itself? Let’s assume my users don’t have a plugin to view svg
files directly in a web browser.
Or is there a way to convert the generated file into an image using
svg-graph itself? Let’s assume my users don’t have a plugin to view svg
files directly in a web browser.
You can generate many file types (PNG, JPEG, GIF and so on)
if you have Ruby/RSVG and Ruby/GdkPixbuf2.
You can also generate PS, PDF, SVG and display your GTK+
widget if you also have rcairo.
Thanks Kou, looks interesting. I couldn’t get cairo to build on my
Solaris box, though - I think the configure script is borked. But, as
long as I can convert to png or jpg, all is well.
You can also generate PS, PDF, SVG and display your GTK+
I have a hunch that Kou’s solution will work much better. In the
semi-recent past I tried using ImageMagick for SVG conversion and got
very poor results. I actually ended up using inkscape as a
rendering/conversion tool, which worked for my needs.
I have a hunch that Kou’s solution will work much better. In the
semi-recent past I tried using ImageMagick for SVG conversion and got
very poor results. I actually ended up using inkscape as a
rendering/conversion tool, which worked for my needs.
pth
Indeed. I’ve discovered that running ‘convert’ over the .svg file
gives me a black and white image. I’m not sure why and I haven’t a
clue what options I should be passing that might fix this, if any. I
may have to give Inkscape a try.
If you (or anyone else out there) has code samples of converting .svg
files to .png files using Kou’s solution, I’d like to see them.
Indeed. I’ve discovered that running ‘convert’ over the .svg file
gives me a black and white image. I’m not sure why and I haven’t a
clue what options I should be passing that might fix this, if any. I
may have to give Inkscape a try.
I just shelled out to inkscape and used command line parameters to
save the output to a png. It was fast and did a nice job.
If you (or anyone else out there) has code samples of converting .svg
files to .png files using Kou’s solution, I’d like to see them.
I have not tried Kou’s suggestion, but was guessing almost anything
would work better than “convert” and also that there was a reasonable
change that gtk shared the svg parse/render with inkscape (but I have
not verified this in any way).
pth
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.