[reportlab-users] Building/Storing PDF's in memory
J. R. Carroll
jrcarroll at jrcresearch.net
Thu Dec 27 11:03:00 EST 2012
Hi Andy,
Thanks - that would be great. I am currently using Canvas, but see myself
doing some platypus work very soon as I am generating quite a few reports.
If you have examples for both that would help quite a bit, but if not,
Canvas is preferred.
-j
----
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:56 AM, Andy Robinson <andy at reportlab.com> wrote:
> 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
>
> _______________________________________________
> reportlab-users mailing list
> reportlab-users at lists2.reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20121227/3e90fc69/attachment.html>
More information about the reportlab-users
mailing list