[reportlab-users] Pagenumbers and table of contents

Andy Robinson andy at reportlab.com
Thu Oct 11 16:11:02 EDT 2007


On 11/10/2007, Sebastian Ware <sebastian at urbantalk.se> wrote:

> Hi!

>

> Can I use SimpleDocTemplate() to create a TOC? How would I specify

> the toc-items and get the automatic page numbers?


SimpleDocTemplate inherits from BaseDocTemplate so you can specialise
it in the same way. It just saves you defining your own frames when
you only want one.

>

> I have seen test_platypus_toc.py but it requires me to specialise

> BaseDocTemplate. Is this the only way?


Regrettably there is no easy way to do these. We still have to remind
ourselves
every time.

If anyone can suggest a nicer API for creating indices and tables -
how to specify what you want indexing - I'd consider implementing it.
Right now it's a PITA. Sorry!


> I also read about something called namedString and getName, but

> couldn't get it to work.

> http://developer.reportlab.com/rsrc/rml_examples/test_012_simpletoc.pdf


Report Markup Language is our commercial software and works a bit
differently; in markup-land it's easier to do a preprocessing pass
than in Python.

If you are using TinyRML or z3c.rml, you'd have to ask the
implementers. If you are working for one of our customers and using
RML(tm), or want to discuss pricing for a real project, we'd be happy
to talk offline (and could provide proper teaching examples).

Best Regards,

Andy Robinson


More information about the reportlab-users mailing list