SelectPdf for .NET - Generate Table of Contents with Html to Pdf Converter - C# / ASP.NET Sample This sample shows how the html to pdf converter can generate page numbers for a table of contents using SelectPdf Pdf Library for .NET. The table of contents (TOC) must already exist at the top of the web page and the items from the table of contents must link to the appropriate sections from the document (like in the test document below). The TOC elements must also have the following CSS classes or ID styles: - all TOC elements (both titles from the actual table of contents, but also the link targets - where the user goes when clicking on a TOC link) must have a specific CSS class ("toc" in our example). - all TOC titles must have similar IDs: TOC_Title{0} (TOC_Title1 to TOC_Title13 in our example). - all TOC targets (document content) must have similar IDs: TOC_Target{0} (TOC_Target1 to TOC_Target13 in our example). All these elements locations are retrieved during the conversion to PDF and those locations are used to get the content page numbers to display them in the table of contents. The font for the page numbers can be specified in code. Also, that style of the line that links the TOC titles with the page numbers. Test document Url: