Henry,

This is working for me using itext-1.4.7:

Paragraph toc = new Paragraph();
paragraph.add((new RtfTableOfContents(
    "RIGHT CLICK HERE AND SELECT \"UPDATE FIELD\" TO UPDATE")));
document.add(toc);
    
// for each chapter
Chunk titleChunk = 
    new Chunk("Some Chapter Title",chapterFont);
RtfTOCEntry tocEntry = new RtfTOCEntry("Some Chapter Title");
tocEntry.setFont(paragraphFont);
Paragraph title = new Paragraph();
title.add(tocEntry);
title.add(titleChunk);
Chapter chapter = new Chapter(title,chapterNumber);
// add the chapter paragraphs to chapter
document.add(chapter)

Stuart

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Henry
Lu
Sent: Friday, December 01, 2006 1:23 PM
To: Post all your questions about iText here
Subject: [iText-questions] table of contents - RTF


Is there anyone who can show me an working example of "Table of 
contents" in RTF?

-Henry

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to