Fri Nov 21, 2025 11:05 am
I want to create a table of contents with dotted lines using Spire.Doc for .NET. The numbering (e.g., 1, 2, 2.1, 3, 3.1, 4, 5) should be generated automatically when I add text, and the page numbers should also update automatically. The text in the table of contents should use a different font size and font name than the headings in the document. For the headings themselves, I need to apply different fonts and styles.
After adding bullets under section 2.1 [Heading 2], the subheadings should appear as:
2.1.1 [Heading 3]
[Text]
2.1.2 [Heading 3]
2.1.2.1 [Heading 4]
[Text]
2.1.2.1.1 [Heading 5]
[Text]
These numbers (e.g., 2.1.2, 2.1.2.1, 2.1.2.1.1) should populate automatically. If I add a new heading like 2.2 [Heading 3], its numbering should also update automatically using Spire.Doc version 13.10.3.
I have attached my sample code. Could you review and modify it as requested, or share a sample code?
Last edited by
eswaribaskar on Tue Nov 25, 2025 5:20 am, edited 1 time in total.