This sample shows how to add a table of contents to PDF documents using Docotic.Pdf library.
Add sections to your PDF document using LayoutContainer.Section method. In the table of contents, use the LayoutContainer.SectionLink or TextContainer.SectionLink methods to add section links. You can use the TextContainer.FirstPageNumber, TextContainer.LastPageNumber and TextContainer.PageCount methods to reference section pages.
This sample code uses free Docotic.Pdf.Layout add-on for Docotic.Pdf library.