[reportlab-users] problem with rlzope and reportlab

Samuele Giovanni Tonon reportlab-users@reportlab.com
Tue, 25 May 2004 11:19:35 +0200


hi,
while playing with reportlab 1.19 on a debian unstable i noticed some
problem with rlzope.py (the external method to use it to create pdf
files) .
The problem is when i have to insert an image:
on rlzope.py on line 75

canvas.drawImage(image, inch, doc.pagesize[1] - inch, width, height)
should be replaced with
canvas.drawInlineImage(image, inch, doc.pagesize[1] - inch, width,
height)

or you will get an 
rawdata = image.getRGBData() AttributeError: JpegImageFile instance has
no attribute 'getRGBData'

after solving this problem i found a problem in 
reportlab/pdfgen/pdfimages.py

in which you have to add 
import sys 
to make line 138 to 142 work:

if sys.platform[0:4] == 'java':
                #jython, PIL not available
                (imagedata, imgwidth, imgheight) = self.JAVA_imagedata()
            else:
                (imagedata, imgwidth, imgheight) = self.PIL_imagedata()


i'm not sure if this is a problem related only to debian (because
of a lack on the package) or it's related to reportlab and rlzope,
however, while in doubt i thought it could be nice to alert you all
about this problem, sorry if it bothers you.

Regards
Samuele