Distrotech / reportlab

Mirror of https://bitbucket.org/rptlab/reportlab
Other
61 stars 41 forks source link

Table of Contents with SimpleDocTemplate #12

Open hidayatrzayev opened 4 years ago

hidayatrzayev commented 4 years ago

There is a great feature in reportlab that easily lets you generate table of contents automatically every time you add some headings in your PDF document. However, this feature works only if you use BaseDocTemplate as your parent class, and not SimpleDocTemplate.

Since SimpleDocTemplate does not override the method multiBuild() from the BaseDocTemplate, which is needed in order to generate the table of contents, I cannot use a feature of SimpleDocTemplate such as onFirstPage and onLaterPages.

Would be nice to add a support for table of contents for SimpleDocTemplate as well.