| Working with C1PrintDocument > Table of Contents |
C1PrintDocument supports automatic generation of table of contents (TOC). The table of contents itself is represented by a dedicated render object, RenderToc, which is derived from RenderArea and adds TOC-specific features. Individual items within the TOC are represented by RenderTocItem (derived from RenderParagraph). Each TOC item holds a hyperlink (the RenderTocItem.Hyperlink property) pointing to a location in the document (represented by an anchor). So, the same mechanism is used for connecting TOC items to document content as for hyperlinks. Convenient methods are provided to create the TOC, see below.
To add a table of contents to your document, do the following:
For a complete sample of how to create the table of contents for a document using the dedicated RenderToc render object, see the RenderTOC sample installed in the ComponentOne Samples folder.