[Image-SIG] Images in Zope/ReportLab

Christopher Lee clee@v1.wustl.edu
Wed, 9 May 2001 06:55:50 -0500 (CDT)


>>>>> "Heiner" == Heiner de Wendt <H.dewendt@systec.de> writes:

    Heiner> Hi,
    >> you can spend all day passing self.image1 to different functions; it
    >> still won't turn itself into a filename.

    Heiner> But how DO I turn it into a filename?


Here's a message exchange between Tim Cook and Ed Colmar that may help:
(Ultimately, you may want to look at Zope's source code.)
-----------------------------------------------------------------------


Hi Tim

Grab my GreetingCard product off zope.org:
www.zope.org/Members/8days/GreetingCard/

To answer your question here is a code snippet:
            ## This file is uploaded by the user into a localFS folder
            uploadedfile = str(self.uploadedimage.file_name())

c.drawInlineImage(uploadedfile,1.25*inch,1.25*inch,width=5.75*inch,height=4*
inch)

            ## This image is a hardcoded logo
            os.chdir('/usr/local/zope/greetingcardLogos/')
            c.drawInlineImage('upsideownlogo.jpg', 3.5*inch,
9.5*inch,width=1.71*inch, height=.72*inch)


     Hope this helps!

    -e-

----- Original Message -----
From: "Tim Cook" <twcook@iswt.com>
To: "ed colmar" <ecolmar@uswest.net>
Sent: Friday, April 27, 2001 9:30 AM
Subject: Re: [reportlab-users] Images and zope


> ed colmar wrote:
> >
> > hey all!
> >
> >     I worked around this same problem by using the LocalFS product to
store
> > the images in the filesystem...  Reportlab easily pulls them in in this
> > case.
> >
>
> Hi Ed,
>
> Mind sharing some sample code?
>
> Let's say you have a LocalFS object with an id of 'image_dir' how
> do you insert 'image01.jpg' in the PDF?
>
> Thanks,
> --
> Tim Cook, President - FreePM,Inc.
> http://www.FreePM.com Office: (731) 884-4126
> ONLINE DEMO: http://www.freepm.org:8080/FreePM
>