[reportlab-users] Page Numbers for my own TOC

Sven Teresniak knorke at 80x25.com
Tue Aug 9 03:30:48 EDT 2011

Hi there,

I'd like to build my own table of contents. I have some sections, all of them
tagged like

canvas.bookmarkPage( section_name )

as well as outline entries like

canvas.addOutlineEntry( "Nice Section Name",
section_name, 1, 0)

Now I want to create my own table of contents at the beginning of the
document. Therefore I need to know which chapter is on which page number or
using some kind of place holder while generating my TOC.

What is the best way to get the page numbers before doing canvas.showPage() on
the TOC page? The section names ("section_name" above) are known when creating
the TOC. Its easy to link the TOC entries with canvas.linkAbsolute() but I
don't know how to get the page numbers.

Maybe I've overseen this in the reportlab user guide. So please feel free to
feed me with the right page in the user guide instead of giving a redundant
introduction. Thanks! :)

By the way: I don't use PLATYPUS, *DocTemplate, TableOfContent Flowables,
because I don't write a book. Until now, the low level canvas methods and
drawing functionalitites were sufficient.

Thanks in advance
Sven Teresniak

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : <http://two.pairlist.net/pipermail/reportlab-users/attachments/20110809/13daada3/attachment.pgp>

More information about the reportlab-users mailing list