[reportlab-users] Problem with renderPM.saveToFile; how to output .PNG?

Robin Becker reportlab-users@reportlab.com
Thu, 14 Aug 2003 17:19:39 +0100

In article <410-220038414122037242@M2W030.mail2web.com>, waxmop@gtcinternet.com
<waxmop@gtcinternet.com> writes
>>>You problably meant to use "drawToFile" instead.
>The graphics guide on page 4 says to use 'saveToFile' rather than
>drawToFile with PNG output:
>If we wanted to generate the same drawing as a bitmap file for a website,
>say, all we need to do is write code like this:
>from reportlab.graphics import renderPM
>renderPM.saveToFile(d, 'example1.png', 'PNG')
....saveToFile is a method of the PMCanvas whilst drawToFile is a module level function.

PythonWin 2.2.3 (#42, May 30 2003, 18:12:08) [MSC 32 bit (Intel)] on win32.
Portions Copyright 1994-2001 Mark Hammond (mhammond@skippinet.com.au) -
 see 'Help/About PythonWin' for further copyright information.
>>> from reportlab.graphics.renderPM import PMCanvas
>>> c = PMCanvas(10,10)
>>> c.saveToFile('/tmp/bongo.png','PNG')

Robin Becker