[reportlab-users] renderPM 'module'
object hasno attribute 'saveToFile'
Robin Becker
robin at reportlab.com
Wed Jul 12 08:23:29 EDT 2006
Genís Pujol wrote:
> Hello,
>
> Thanks for your help, I think I'm missing something though, because I'm not getting any output with the instruction you sent me:
>
> Python 2.4.2 (#1, Jun 16 2006, 16:17:38)
> [GCC 4.1.0 (SUSE Linux)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> from reportlab.lib import colors
>>>> from reportlab.graphics.shapes import *
>>>> from reportlab.graphics import renderPM
>>>> d = Drawing(400, 200)
>>>> d.add(Rect(50, 50, 300, 100, fillColor=colors.yellow))
>>>> d.add(String(150,100, 'Hello World', fontSize=18, fillColor=colors.red))
>>>> d.save(formats=['PNG'],outDir='/tmp',fnRoot='example1.png')
> ''
>
> This doesn't create any file.
>
> Any ideas?
>
>
> Genís
.....
the existing code doesn't like upper case extensions try png and leave off the
.png on the fnRoot
--
Robin Becker
More information about the reportlab-users
mailing list