Free Support Forum - aspose.com

How to format table of content using .NET

Hi


I’m using the following code to add a table of content:

_docBuilder.InsertTableOfContents("\o “1-3” \t “Heading 1,1,Heading 2,2,Heading 3,3” \h \z \u"); //"\o “1-3” \h \z \u");//\t “Heading 1,1,Heading 2,2,Heading 3,3” \u
However, our marketing people would’ve liked to have a lot more granular control on how it is styled. I had to tell them that it is mostly out of my hands, because everything is done by this method.

However, we did compromise that we’ll try to increase the line spacings. However, the following code seems to have absolutely no effect:

_docBuilder.Font.Spacing = 20;
_docBuilder.InsertTableOfContents("\o “1-3” \t “Heading 1,1,Heading 2,2,Heading 3,3” \h \z \u"); //"\o “1-3” \h \z \u");//\t “Heading 1,1,Heading 2,2,Heading 3,3” \u

Is there a way I could accomplish this?

Thanks

Hi Hanno,

Thanks for your query. Please read following forum link for your kind reference. For line space, please use SpaceAfter or SpaceBefore properties of ParagraphFormat class.

https://forum.aspose.com/t/52359

Thanks! This has lead me down the right track.