This is a migrated thread and some comments may be shown as answers.

Kendo-pdf-export add page number to table of content

1 Answer 451 Views
PDF Export
This is a migrated thread and some comments may be shown as answers.
Florian
Top achievements
Rank 1
Florian asked on 11 Feb 2019, 11:28 AM

Hi,

I´m currently using ExportPDF to create a PDF with a TOC in it. The chapter and subchapters are created dynamically (for the TOC and in the text). I know how to add page numbers in the footer, but is there a way to add the right page number to each chapter in the table of content?

Thanks in advance

1 Answer, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 13 Feb 2019, 09:54 AM
Hello Florian,

As there is no way to know in advance which pages from the generated document the respective chapters will start on, I am afraid the desired functionality is not available, and cannot be achieved solely via the built-in API and configuration options available.

In theory, you can add some custom logic for breaking the pages at certain points via the forcePageBreak option, and additional logic to calculate how many pages each chapter will take, based on the font size, page size, margins, etc., but there could be hardly a generic or out-of-the-box solution for this functionality, and this is why it is not supported.

Regards,
Dimiter Topalov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
PDF Export
Asked by
Florian
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Share this question
or