[reportlab-users] TableOfContents addEntry doesn't work?

Robin Becker robin at reportlab.com
Fri Feb 16 05:02:42 EST 2018


Hi Mike,

you hit on a dirty secret of rendering processes. The toc is intended to be created alongside the rendering process which makes it 
much harder to do as you intend which is to construct a static story with a TOC. TableOfContents relies on there being a change in 
the table of contents during the build and only the last version gets to be shown.
-- 
Robin Becker

On 16/02/2018 02:19, Mike Driscoll wrote:
> Hi,
> 
> I was trying to follow along with ReportLab's user guide's instruction on
> creating a table of contents using the addEntry method and I can't seem to
> get it to work. It just keeps adding a TOC placeholder in instead of adding
> the actual table of contents.
> 
> Here is my code:
> https://gist.github.com/driscollis/69d4ef8a3f3714484e0788d747b3d5d5
> 
> Could someone tell me what I am doing wrong?
> 
> I have tried the afterFlowable() override that it mentions as well and that
> works, but I wanted to know why doing it the other way does not.
> 
> Thanks,
> Mike
> 
> -----------------
> Mike Driscoll
> 
> Blog:   http://blog.pythonlibrary.org
> Books: Python 101 <https://gum.co/py101>, Python 201: Intermediate Python
> <https://gum.co/py201>
> 
> 
> 
> _______________________________________________
> reportlab-users mailing list
> reportlab-users at lists2.reportlab.com
> https://pairlist2.pair.net/mailman/listinfo/reportlab-users
> 




More information about the reportlab-users mailing list