I am generating PDF using iText and XMLWorker. There problem is we need to generate the TOC for the PDF with page no. I am having mt section headings in a list. With this list i can generate the TOC without page no. But our requirement is we need page no also. Below is my list containing section details.
List<String> sectionList=new ArrayList<String>();
sectionList.add("Section1");
sectionList.add("Section2");
sectionList.add("Section3");
sectionList.add("Section4");
sectionList.add("Section5");`
My CLOB object is
String pdfString="<h1>Section1</h1><p>Some content for section1</p>" +
"<h1>Section2</h1><p>Some content for section2</p>" +
"<h1>Section3</h1><p>Some content for section3</p>" +
"<h1>Section4</h1><p>Some content for section4</p>" +
"<h1>Section5</h1><p>Some content for section5</p>";
Section contents will be more than 1 page so we need the page no in TOC. is there any wat to achieve this. NOTE This is a sample we have many sections and subsections.