[reportlab-users] Return a file object rather than save a file...

Andy Robinson andy at reportlab.com
Fri Oct 2 04:03:32 EDT 2009

2009/10/2 Brower Jason <Jason.Brower at kone.com>:

> After a look through the main documentation I found section 2.2 and it

> shoulds how to open a file like object and insert a pdf into that.  But I

> would like to have just the file object itself to return as a downloadable

> stream. (I am using web2py)

I am not familiar with web2py, but if there is some kind of file-like
response object you can write to, then pass that to the Canvas
constructor. Alternatively, create a StringIO object (which is
file-like) and use that.

Best Regards,

Andy Robinson

More information about the reportlab-users mailing list