Hi Mark,
I tried out RTfParagrapgh Style but found that headers are added to table of
contents only when I use,
RtfParagraphStyle.STYLE_HEADING_1
RtfParagraphStyle.STYLE_HEADING_2
RtfParagraphStyle.STYLE_HEADING_3
When I use following, It doesn't add to table of contents :
RtfParagraphStyle head = new RtfParagraphStyle("head",
"Bold",RtfFont.NORMAL, Color.BLACK); // Set the TOC style
writer.getDocumentSettings().registerParagraphStyle(head);
Paragraph ph = new Paragraph(sectionTitle,head);
This could work for me, if I know how to associate the font size for
RtfParagraphStyle.STYLE_HEADING_1.
Any light on this would do me good !
Thanks
Bhupat
-----Original Message-----
From: Mark Hall [mailto:[EMAIL PROTECTED]
Sent: Sunday, July 16, 2006 8:57 AM
To: Post all your questions about iText here
Cc: Bhupat Raigaga; Alin Popa
Subject: Re: [iText-questions] RtfTOC how to set fonts and indentation for
each entry
On Friday 14 July 2006 21:02, Bhupat Raigaga wrote:
> 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
> ?
To set the font in the TOC you need the current iText release and then add
the
following code right after where you created the RtfWriter2:
RtfWriter2 writer2 = RtfWriter2.getInstance(doc, new
FileOutputStream("test.rtf")); // Create the RtfWriter2
writer2.getDocumentSettings().registerParagraphStyle(new
RtfParagraphStyle("toc 1", "Times New Roman", 9, Font.NORMAL,
Color.BLACK)); // Set the TOC style
Greetings,
Mark
--
It was all so different before everything changed.
My GPG public key is available at:
http://www.edu.uni-klu.ac.at/~mhall/data/security/MarkHall.asc
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions