[reportlab-users] fileobject instead saving....

Andy Robinson andy at reportlab.com
Thu Apr 3 01:44:20 EDT 2014


When you create a canvas, you can pass in a file-like object instead
of a filename. Also, when you create a platypus document, the same is
true. e.g.

buf = StringIO.StringIO()
c = Canvas(buf)
...draw stuff...
c.save()

return buf.getvalue()

This should be covered in the user guide; it's what most people do on
web servers for small documents.

- Andy

On 3 April 2014 06:31, Tamer Higazi <th982a at googlemail.com> wrote:

> Hey users!

> I have an important question. Is there a way, instead of saving the

> canvas, or better said the endresult in a pdf file by just receiving

> back the file object ?!

>

> I would kindly thank you

>

>

>

> Tamer

>

>

>

>

>

> _______________________________________________

> reportlab-users mailing list

> reportlab-users at lists2.reportlab.com

> http://two.pairlist.net/mailman/listinfo/reportlab-users




--
Andy Robinson
Managing Director
ReportLab Europe Ltd.
Thornton House, Thornton Road, Wimbledon, London SW19 4NG, UK
Tel +44-20-8405-6420


More information about the reportlab-users mailing list