[reportlab-users] Building/Storing PDF's in memory

Tim Roberts timr at probo.com
Thu Dec 27 12:23:57 EST 2012


J. R. Carroll wrote:

>

> Does ReportLab (opensource) offer support for PDF generation in

> memory? I want to build and store the PDF in memory (and then flush

> it from memory once it has been served).


ReportLab always stores the entire document in memory (as an object
tree). When you call canvas.save, it uses xxx.write to write the
contents to the object you passed to the canvas constructor. As always
in Python, it doesn't care what the object actually is. As long as it
has a "write" method, it can be used as a sink for the PDF data.
StringIO works, but you can also pass your own object.

--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the reportlab-users mailing list