I know there has been some talk about generating a table of contents in PDF exports-- has anybody figured out a way where each section can figure out what page it is on and generate a TOC from there? Using with drawDOM.
3 Answers, 1 is accepted
Hello,
Currently, this is not supported by the PDF export as it is only exporting what is rendered in the DOM.
Our reporting product support table of content to the export documents. Please take a look at it, and if it is some you are interested in, please post a question in the report forum or a ticket, where the team can share more details on it, to see if it will be a fit for the real use case:
https://docs.telerik.com/reporting/table-of-contents
Regards,
Stefan
Progress Telerik
Hi Stefan,
Thank you! I don't have access to the Reporting support forums as I do not have a license to the product. Essentially I have a React app (via create-react-app) where users enter information and a PDF is created with their dynamic info. As such, page numbers may vary across the PDFs. Using Firebase Functions as the backend. Would this be possible to implement on this? I'm not even sure where I would begin...
Thanks,
Alexa
Hello, Alexa,
The reporting tool as a free trial which will give you access to the support system and the forums as well.
As with the KendoReact PDF export and idea that comes to mind is the following:
1) Build the Table of content dynamically based on what the user has typed. For example, in the information entered by the user, but all heading in h tags, and then loop over all h tags in the document to create the content in HTML element.
2) When the export button is clicked, render that table of content(a DOM element) before the elements that will be exported.
3) After the export remove the element so it does not stay on the page.
This is not a straight forward task and it will require modifications based on the real application logic, but it is possible to achieve.
Regards,
Stefan
Progress Telerik