Free Support Forum - aspose.com

TOC un-numbered entry

I am using the table of contents listsection. How do I create an un-numbered header in a TOC, where the other entries are numbered? For instance there is an Introduction chapter which is not numbered and the rest of the chapters are numbered. So it should look like:

TABLE OF CONTENTS

INTRODUCTION

1 FIRST CHAPTER

1.1 Section one of first chapter, etc...

2 SECOND CHAPTER

Also, How do I control the font size for the initial TABLE OF CONTENTS line in the listsection? It is appearing in a huge font.

Regards,

Jerry Howar

Dear Jerry,

Thank you for considering Aspose.

1) It is not supported to create un-numbered items in the TOC while other items are numbered. But if you create un-numbered heading in the section, the item in TOC will be automatically un-numbered.

2) You can control the font size of the title of TOC, for example:



Table Of Contents


How would that font sizing code look in C# ? I'm using C# to create the pdf document.

Thanks,

Jerry

You can write your code like the following:

ListSection tocSection = new ListSection("Table of content");

Text text = tocSection.Paragraphs[0] as Text;
text.Segments[0].TextInfo.FontSize = 10;