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

Andy Robinson andy at reportlab.com
Thu Dec 27 10:56:54 EST 2012


StringIO is very easy. Where you would normally pass a filename to our
APIs, you just pass a file-like object. Are you using the Canvas, or
Platypus? I can post an example.

- Andy

On 27 December 2012 15:47, J. R. Carroll <jrcarroll at jrcresearch.net> wrote:


> I have not! Thank you, I'll look into that. (I've not attempted to this

> before, so I'm trying to find the right tools).

>

> Do you know if tempfile builds in memory, or does it just temp write to

> the disk (and then is responsible for deleting the data)? Only asking

> because I've never used tempfile before either and I'm curious to know if

> that is a potential solution as well - I have no affinity one way or the

> other.

>

>

> ----

>

>

> J. R. Carroll

> Independent Researcher through Hurtz Labs

> Research Methods, Test Development, and Statistics

> www.jrcresearch.net

> www.ontvp.com

> Cell: (650) 776-6613

> Email: jrcarroll at jrcresearch.net

> jrcarroll at hurtzlab.com

> jrc.csus at gmail.com

> <https://www.facebook.com/J.R.Car> <https://twitter.com/jNammer><http://www.linkedin.com/in/jrcarroll>

>

>

>

> On Thu, Dec 27, 2012 at 10:41 AM, Adrian Klaver <adrian.klaver at gmail.com>wrote:

>

>> On 12/27/2012 07:31 AM, J. R. Carroll wrote:

>>

>>> Hi list,

>>>

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

>>>

>>> If not, is my best alternative tempfile?

>>>

>>

>> Have you looked at StringIO?:

>>

>> http://docs.python.org/2/**library/stringio.html#module-**StringIO<http://docs.python.org/2/library/stringio.html#module-StringIO>

>>

>> or its replacement in newer versions of Python io.StringIO():

>>

>> http://docs.python.org/2/**library/io.html#module-io<http://docs.python.org/2/library/io.html#module-io>

>>

>>

>> They both allow you to build in memory files.

>>

>>

>>> -J

>>>

>>

>>

>>

>> --

>> Adrian Klaver

>> adrian.klaver at gmail.com

>>

>>

>

> _______________________________________________

> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20121227/c36e9617/attachment.htm>


More information about the reportlab-users mailing list