Hi Team,
I am generating TOC using below code…
private void generateTableOfContents(DocumentBuilder builder) throws Exception {
builder.getCurrentParagraph().getParagraphFormat().setStyleIdentifier(StyleIdentifier.TOC_HEADING);
builder.writeln(“Table of Contents”);
//builder.insertTableOfContents("\\o \"1-5\" \\h \\z \\u");
builder.insertTableOfContents("\\o \"1-3\" \\h \\z \\u");
builder.insertBreak(BreakType.PAGE_BREAK);
// Start the actual document content on the second page.
builder.insertBreak(BreakType.SECTION_BREAK_NEW_PAGE);
}
I am able to generate TOC but TOC does not show “Table Of Contents text with Page number as first thing”.
Please see attached documents for more clarity and compare both.
Thanks,
Vaibhav DiwanTable of contents.zip (23.0 KB)