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);

 

 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to