[reportlab-users] What's wrong with this ?
Ian Sparks
reportlab-users@reportlab.com
Mon, 23 Feb 2004 12:12:11 -0500
This is a multi-part message in MIME format.
------_=_NextPart_001_01C3FA30.2CC3938D
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Worked for me with a sample .png file. Attachment here (probably blocked =
but I tried).
PIL : 1.1.3
Python 2.1
-----Original Message-----
From: philippe shrom [mailto:shrom@admin.zzn.com]
Sent: Monday, February 23, 2004 11:51 AM
To: reportlab-users@reportlab.com
Subject: [reportlab-users] What's wrong with this ?
Hi everebody,
I'm trying to include an image in a canva with drawImage like it is
specified in docs: "The image parameter may be either a
PIL Image object or an image filename."
here is the code:
from reportlab.pdfgen import canvas
import Image
c =3D canvas.Canvas( "imagetest.pdf" )
img =3D Image.open('pict/logo.png')
c.drawImage(img, 150, 150 )
c.showPage()
c.save()
Here is the error:
Traceback (most recent call last):
File "drawlogo.py", line 10, in ?
c.drawImage(img, 150, 150 )
File
"E:\programmation\python\python2.3\Lib\site-packages\reportlab\pdfgen\can=
vas.py", line 586, in drawImage
rawdata =3D image.getRGBData()
AttributeError: PngImageFile instance has no attribute 'getRGBData'
I looked at the source code of canvas.py and it is said:
"Draws the image (ImageReader object or filename) as specified"
Do I have to provide an ImageReader object or a PIL image object ?
Python 2.3.2
PIL 1.1.4
Windows 2000
Get your Free E-mail at http://admin.zzn.com
___________________________________________________________
Get your own Web-based E-mail Service at http://www.zzn.com
_______________________________________________
reportlab-users mailing list
reportlab-users@reportlab.com
http://two.pairlist.net/mailman/listinfo/reportlab-users
------_=_NextPart_001_01C3FA30.2CC3938D
Content-Type: application/x-zip-compressed;
name="imagetest.zip"
Content-Transfer-Encoding: base64
Content-Description: imagetest.zip
Content-Disposition: attachment;
filename="imagetest.zip"
UEsDBBQAAAAIAClhVzC6AOKefwAAAK4AAAAMAAAAaW1hZ2V0ZXN0LnB5LYy7DsIwDEX3Sv0Hq0tT
CVkwMDIxsfELJnVCpOahJGp/n8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