[reportlab-users] Multipage pdf

Andy Robinson andy at reportlab.com
Mon Jun 22 12:10:22 EDT 2009


2009/6/22 Simone Dalmasso <simone.dalmasso at gmail.com>:

> Hi, I would like to build a script which creates a pdf with a content

> depending of user requests.

> The pdf is requested via http and it contains some tables. The user can

> request more than one table and the table could be longer tha an A4 page.

> For now I can print one table at time using the Table platypus. Can you tell

> me which is the best way to add more tha one table and in more than one

> page?


Have you read the chapter of the User Guide on "Platypus"? It's all
about multi-page documents. Also, I suggest studying the scripts in
the tests/ folder, especially the ones with 'platypus' in the name;
some of these generate documents with tables.


> Maybe I have to use a DocTemplate but is not clear how to use it with a

> table and on an http response.


The HTTP part is nothing to do with ReportLab; it depends entirely
which web framework you are using. However, it may be useful to know
that you can save a document to a cStringIO buffer instead of a file
on disk. There's a small example in the Django wiki which should get
you started:

http://docs.djangoproject.com/en/dev/howto/outputting-pdf/

- andy


More information about the reportlab-users mailing list