[reportlab-users] table of contents for long report

Robin Becker robin at reportlab.com
Sun Jan 21 06:59:44 EST 2007


George Kappel wrote:
.........

>>>

>> .......

>> George there are a couple of tests related to this,

>> test_platypus_toc.py

>> & test_platypus_toc.py. When run the pdfoutput should indicate the

>> capabilities for toc and pdf bookmarks etc etc.

>> --

>> Robin Becker

>

> Thanks for the info, I am not using Platypus, just canvas. I will look at

> Platypus some more but it looks like the table of contents feature requires

> multiple passes of the "Story" so I would be a little concerned with

> performance since this is a 1,000+ page report

.....

actually a TOC doesn't require multiple passes. The simplest TOC does it
by placing a form at the beginning of the report and then defining it at
the end of content. Of course if you need multiple pages for the TOC you
have to know how many pages and define forms with names like TOC1 TOC2
..... etc etc. If you don't actually know how many items will be
required then I suppose you could insert the forms dynamically as they
are required, but that requires you to have the PDF elements indexable
somehow ie in platypus we have a list. Platypus uses multi-pass for more
than just TOC fillins ie there are see section x or see page x
constructs that can be determined as the story is built up.
--
Robin Becker


More information about the reportlab-users mailing list