[Image-SIG] Images in Zope/ReportLab
Wed, 9 May 2001 09:55:45 +0200
Must be name clash between PIL.Image and "Zope".Image ...
----- Original Message -----
From: "Heiner de Wendt" <H.email@example.com>
Sent: Wednesday, May 09, 2001 9:33 AM
Subject: [Image-SIG] Images in Zope/ReportLab
> Hi all,
> I'm trying since days to get this working, and start becoming
> somewhat desperate.
> I want to use Zope and ReportLab to create PDFs from within Zope. It
> works in general, but I don't manage to include images in the PDFs.
> When I do it locally (i.e. without Zope), it works fine, but I just
> don't manage to access the images in the ZODB in the right way.
> Here's an example code:
> def page1(self,c,my1,my2):
> def get(self):
> import PIL.Image
> from reportlab.pdfgen import canvas
> c = canvas.Canvas("/opt/zope/2-3-0/pdffiles/pdf1.pdf")
> I've tried various things in the "drawInlineImage" line, even
> directly giving the image name ('image1'), but ReportLab doesn't find
> The strings my1 and my2 give the following results:
> my1 (which is self.image1.id) : <Python Method Object at 8b785f0>
> my2 (which is self.image1): <img src="[complete URL here]/image1"
> alt=".." height="80" width="100" border="0"/>
> So, when creating the strings, the image *is* found. I just don't
> know how to correctly access it in the drawInlineImage line.
> Can someone PLEASE help me? I'm really somewhat desperate by now...
> Big thanks in advance,
> Image-SIG maillist - Image-SIG@python.org