[reportlab-users] PDF Generation performance

Shayan Raghavjee reportlab-users@reportlab.com
Wed, 24 Dec 2003 14:16:24 +0200

Thanks for the input. Forms sound promising, but the issue I may have is 
each page would have multiple changes, not just 1 as with a serial 
number, one of the tables has different information in it for each page. 
Even so, a little re-arranging and I could definately make the top half 
a constant.

I have broken the form down into small tables, each page has it's own 
little set of tables. All page breaks are manually inserted, and there 
isn't any cell size calculations either, those are mostly preset.

John Precedo wrote:

>Hi Shayan
>I tend not to work with the open source stuff, but I can point you at the
>sort of things that are mentioned when large reports with tables are
>The first thing is - are you doing everything in a single table? It is both
>better and faster to do multiple small tables rather than one huge one, or
>even a few big ones. With tables which spread over multiple pages you get a
>lot of time being wasted in repagination and calculating how the cells need
>to be resized or flipped onto the next page. You can avoid all this pain by
>having multiple smaller tables which don't need to do all this calculation.
>(Another minor point is that tables don't have to be nested - it can be
>visually equivalent to have totally separate tables which but up against
>each other with no space separating them - unless a page break is involved).
>The other thing is using forms. You say a lot of the info is duplicated -
>using forms can drastically improve timings.
>This is describe in section 4.1 of the ReportLab User Guide:
> "The Form feature lets you create a block of graphics and text once
>  near the start of a PDF file, and then simply refer to it on
>  subsequent pages. If you are dealing with a run of 5000 repetitive
>  business forms - for example, one-page invoices or payslips - you only
>  need to store the backdrop once and simply draw the changing text on
>  each page. Used correctly, forms can dramatically cut file size and
>  production time, and apparently even speed things up on the printer."
>Hope these hints are of some use to you - if not, perhaps Robin or Andy or
>one of our other developers would be able to assist more.
>Regards (and a Merry Xmas),
>John Precedo               (johnp@reportlab.com)
>Reportlab Europe Ltd  (http://www.reportlab.com)
>reportlab-users mailing list