[reportlab-users] the ever growing PDF

Robin Becker robin at reportlab.com
Fri Jan 26 06:39:18 EST 2007


dimitri pater wrote:

> Hi,

> I have been working with Reportlab now for the 2 months and it is really

> amazing. Big thanks to the developers of Reportlab!

> I am working on an app that uses CherryPy (a HTTP framework), MySQL, PIL

> and

> Reportlab. The user uses HTML forms to create reports in PDF and it all

> works very nice. However when I create a PDF (calling the project_id as an

> argument) for the second (and third and so on), within the same session,

> all

> data is appended to the generated PDF (it grows and grows). This happens

> also when I remove the PDF from the disk before generating the report for

> the second time. Only when I start en stop the CP server process, this

> doesn't happen. But that isn't very elegant (and I loose the session

> info..).

> Now, is there a way to 'reset' the PDF before it is generated.

> I hope I am clear enough and if you need more info, just tell me

>

> best regards,

> Dimitri

......

You don't say which technology you're using. Platypus or Canvas. Usually the
answer is to create a new canvas or doctemplate for each request and to ensure
that the request finalizes the object at the end. There's no point in worrying
about resetting a simple file.

Perhaps you should outline the start and end of the PDF document in your request
handler.
--
Robin Becker


More information about the reportlab-users mailing list