in reply to Rendering of SVG content with GD into PNG file

Hi, I just posted an example SVG viewer for Perl/Gtk2 in which Gtk2 can load and display an SVG file. Now once it's loaded and sized, you can probably can work out a way to save the pixbuf as a png or jpg. Or you could use imageMagick's import to capture the window. Of course, this requires you have X running.

You could also look at libsvg, and maybe make a Perl interface to it?


I'm not really a human, but I play one on earth. flash japh
  • Comment on Re: Rendering of SVG content with GD into PNG file

Replies are listed 'Best First'.
Re^2: Rendering of SVG content with GD into PNG file
by cosimo (Hermit) on Feb 08, 2006 at 17:32 UTC

    Thank you guys for your suggestions, but I realized I need to clarify a bit what I'm doing.

    What I'm trying to achieve is creating a new blank GD::Image and draw inside it with all the (already existing) graphics primitives of GD. One (or more) of these drawing operations should render SVG text "documents" onto the existing GD::Image.

    I'd like to mix and match classic GD drawing (line, rectangle, filledRectangle, ...) with SVG drawing (ex.: $gdImage->svgDraw($svgtext)).

    This should be good to "prepare the way" to SVG. I mean, when (and only God knows) Internet Explorer will have SVG support, we could directly render into SVG, because all the underlying data is already in that format.

    Nevertheless, I'm going to take a closer look at your example (++), at Image::Magick's SVG features and libsvg, which are all quite interesting.