QuestPDF / QuestPDF

QuestPDF is a modern open-source .NET library for PDF document generation. Offering comprehensive layout engine powered by concise and discoverable C# Fluent API. Easily generate PDF reports, invoices, exports, etc.
https://www.questpdf.com
Other
12k stars 629 forks source link

How can I make a table of contents? #608

Closed leandrobattochio closed 1 year ago

leandrobattochio commented 1 year ago

I just found this lib and it is very good but one thing I don't understand and didn't find any information of how to do is a table of content, like this one: image

I'm using QuestPDF to generate a report, it's a dynamic report, may have random number of pages but it follows a structure and table of contents is one of the required features of the report.

How would I go to achieve this feature and generate a dynamic table of contents based on the current document I'm generating?

bennetbo commented 1 year ago

Here is an example of how to generate a dynamic TOC.

leandrobattochio commented 1 year ago

What do I do with TableOfContentsTemplate? How to use it? Should I copy and paste? Should I be able to run QuestPDF.ReportSample project to get a preview of an example report?

girlpunk commented 1 year ago

Read the code and implement something similar in your program?