Hi,
I am using itext for Rtf generation and it works
pretty good for my 90% needs.
However, I’m little stuck while generating table
of contents. In The code shown below
setting font and indentation Doesn’t seem to
work . How to make this work ?
Code:
I have main table of entry as :
tocTitle.add(new
RtfTableOfContents("Table of Contents", f));
iTextDoc.add(tocTitle);
Adding TOC entry:
Font f =
FontFactory.getFont(FontFactory.TIMES_BOLD, 12f);
com.lowagie.text.rtf.field.RtfTOCEntry TOCEntry =
new com.lowagie.text.rtf.field.RtfTOCEntry(sectionTitle,
f);
TOCEntry.setFont(f);
iTextDoc.add(rtfTOC);
I also tried this,
Paragraph tocPar = new Paragraph();//("Table of
Contents", f);
tocPar.setAlignment(Paragraph.ALIGN_CENTER);
tocPar.add(TOCEntry);
tocPar.setIndentationRight(5);
tocPar.setExtraParagraphSpace(5f);
iTextDoc.add(tocPar);
Attachment: cid:image001.gif@01C6A73D.72FAF1D0