[reportlab-users] SVG?

Tim Roberts timr at probo.com
Fri Jun 16 13:50:53 EDT 2006


I was playing with renderSVG today.  I couldn't get Firefox to recognize
the file as SVG until I added an xmlns declaration to the header.  In
renderSVG.py, at line 123, in function SVGCanvas.__init__, I added the
following marked lines:

        implementation = getDOMImplementation('minidom')
        self.doc = implementation.createDocument(None, "svg", None)
        self.svg = self.doc.documentElement
        self.svg.setAttribute("width", str(size[0]))
        self.svg.setAttribute("height", str(self.height))
        self.svg.setAttribute("xmlns",
"http://www.w3.org/2000/svg")        ##
        self.svg.setAttribute("xmlns:link",
"http://www.w3.org/1999/xlink") ##
        self.svg.setAttribute("version",
"1.0")                             ##
        self.svg.setAttribute("baseProfile",
"full")                        ##

I admit to being too much of an SVG novice to know if all of those are
required, but I suspect at least the "xmlns" attribute is.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the reportlab-users mailing list