[reportlab-users] renderPS drawToString patch

Dirk Datzert reportlab-users@reportlab.com
Thu, 12 Dec 2002 22:00:20 +0100


Dies ist eine mehrteilige Nachricht im MIME-Format.
--------------9303A543F907133FB2AAB9C0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi Andy,

here is the renderPS-drawToString patch.

Regards,
Dirk
--------------9303A543F907133FB2AAB9C0
Content-Type: text/plain; charset=us-ascii;
 name="renderPS-drawToString.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="renderPS-drawToString.patch"

diff -uNr reportlab/graphics/renderPS.py reportlab-1.17/graphics/renderPS.py
--- reportlab/graphics/renderPS.py	Thu Dec 12 21:57:04 2002
+++ reportlab-1.17/graphics/renderPS.py	Thu Dec 12 21:56:43 2002
@@ -809,6 +809,12 @@
     draw(d, c, 0, 0, showBoundary=showBoundary)
     c.save(fn)
 
+def drawToString(d, showBoundary=rl_config.showBoundary):
+    "Returns a PS as a string in memory, without touching the disk"
+    s = getStringIO()
+    drawToFile(d, s, showBoundary=showBoundary)
+    return s.getvalue()
+
 #########################################################
 #
 #   test code.  First, defin a bunch of drawings.

--------------9303A543F907133FB2AAB9C0--