[Zope] ReportLab + Zope : here's a working example

Tom Deprez Tom Deprez" <tom.deprez@uz.kuleuven.ac.be
Wed, 13 Feb 2002 17:05:07 +0100


> > I haven't looked at the code yet, but I remember having the same
problems
> > with my report lab pdf creation...
> > When I opened the created pdf file with the 'rb' parameter it worked
> > perfectly...
> >
> > as in return open(filename,'rb').read()
>
> Oh, yes !
>
> This would explain why it works fine if the server is under *Nix and not
> if it is under Windows.

Correct.

> However no open is done, the file is built in memory with a cStringIO and
> returned to the browser using StringIO's getvalue() method.
> How could I make it binary safe ?

Urgh, sorry, don't know... I wish I knew it myself... that's why I moved to
storing it on a file and then opening the file. What I do is to make a file
in the tempory directory of the server. I wished I didn't had to use this
method.

Regards, Tom.