[reportlab-users] rednerSVG drawToString

Dirk Datzert reportlab-users@reportlab.com
Sat, 21 Sep 2002 17:06:41 +0200


Hi,

I had the need to render SVG in memory. I placed a
drawToString()-Function in renderSVG:

def drawToString(d, showBoundary=rl_config.showBoundary):
    "Returns a SVG as a string in memory, without touching the disk"
    s = getStringIO()
    drawToFile(d, s, showBoundary=showBoundary)
    return s.getvalue()

Regards,
Dirk