[cairo] PyCairo SVG/PDF support on Windows?

Carl Worth cworth at cworth.org
Thu Aug 3 08:47:57 PDT 2006

On Wed, 5 Jul 2006 01:29:25 +0200, "Michael Knopf" wrote:
> I've been looking for a python based possibility to load svg data and render
> it to bitmap (png) and pdf files at the same time. I ended up with Cairo and
> already got it working so far on my linux box. But it does not work on
> Windows, neither works the example code "svgconvert.py". The submodule svg
> is missing. The readme says that it is only aviable if certain libs are
> installed. It seems like libs for SVG support and PDF are missing.

I looked into this a bit and apparently pycairo includes a "cairo.svg"
module that requires libsvg-cairo.

That's not a good situation for two reasons:

1) Pycairo should really bind only the functionality of cairo. Cairo
   itself does not include SVG parsing, so pycairo shouldn't include
   a cairo.svg module that adds that.

2) The libsvg-cairo library is totally unmaintained.

So instead, librsvg exists which is a library that supports much more
of the SVG specification than libsvg-cairo did, (which originally was
forked from a much older version of librsvg). And recent versions of
librsvg also render through cairo.

I'm also told that python bindings for librsvg exist. This is good and
as it should be: separate bindings for separate libraries.

Of course, the python bindings for librsvg and for cairo should be
made to work smoothly together. I don't know if that's the case
currently, but I hope so.

> Could I get a list of what I need to install on my windows machine to get
> svg->png and svg->pdf to work? Are there binaries or do I need to compile it
> myself (never have done that on Windows before).

I don't know anything about what exists in pre-compiled form for the
Windows platform. As you find stuff though, feel free to put notes
into the cairographics.org web pages so that others can find it more
easily than you did.

And have fun with cairo!


PS. One thing that might be a bit more tricky with librsvg (compared
to libsvg-cairo) is that it has dependencies on at least glib, (and
maybe GTK+ as well), so it will require those libraries to also be
available. (This is one aspect of the libsvg-cairo fork that
unfortunately didn't make it into the cairo-ification of librsvg).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060803/cb6f7e61/attachment.pgp

More information about the cairo mailing list