Re: fileobject instead saving....

Andy Robinson <[email protected]>
Newsgroups gmane.comp.python.reportlab.user
Message-ID <CABjtApveLTWBYxNqAen4pKVEg0E2QNsk5H_8AvOS-pOS8U2y3Q@mail.gmail.com>
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 <[email protected]> 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
> [email protected]
> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.