function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Israel JimenezIsrael Jimenez 

Table of Contents / Indice in renderAs PDF visualforce page

Hi, 

I have a problem, I need to create a table of contents where every topic have a page number dynamically, example:

Table of Contents

Presentation___________ 1
Tittle 1 ________________2
Tittle 2 ________________5
Questions _____________10


 I'm using the next code to add every page number in the footer
<span class="pagenumber"/>
But I need to add the number in my table of content and I don´t know how..., no static form, because the Tittle 1 or  2 can be in the same page or different page, depending the information of the wrapper.

Please, I hope someone helps me.
Greatings, and thanks.
 
AnudeepAnudeep (Salesforce Developers) 
You can try achieving this using offset. Although this example shows how to add page numbers links to pagination, I believe you can leverage the same logic
 
Israel JimenezIsrael Jimenez
Thank you, 

I tried but by the renderAs PDF, doesn´t work!