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

Jerome Alet alet@unice.fr
Wed, 13 Feb 2002 16:48:38 +0100 (MET)


On Wed, 13 Feb 2002, Tom Deprez wrote:

> 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.

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 ?

thanks in advance.

Jerome Alet