Hi Mark,

 

Thanks for the quick response. So if I understand correctly, For different chapters I would have different font i.e.

 

If I have

 

Chapter 1.

   Section 1

      Anbnbsjakslklakls

   Section 2

 

   Section 3 ......

 

 

Chapter 2

   Section 1

      Mnkjkjlklkl

   Section 2

 

I would like TOC as

Chapter 1

   Section 1

   Section 2

   Section 3

Chapter 2

   Section 1

   Section 2

 

With your way I would have same font for Chapter 1 TOC and then have different font

For Chapter 2 TOC.

 

Is that correct ? thanks.

How would I achieve what TOC I printed above ?

 

Thanks

 

Bhupat

 

-----Original Message-----
From: Mark Hall [mailto:[EMAIL PROTECTED]
Sent: Monday, July 17, 2006 2:47 PM
To: [email protected]
Cc: Bhupat Raigaga
Subject: Re: [iText-questions] RtfTOC how to set fonts and indentation for each entry

 

On Monday 17 July 2006 18:44, Bhupat Raigaga wrote:

> This does help in setting RtfTOC font, but It applies the same style to

> whole document. I need to have Sections BOLD and rest normal font.

Then you need to use more styles. Use the RtfParagraphStyle.STYLE_HEADING_N

styles for your chapters and sections:

 

Chapter ch = new Chapter(new Paragraph("Chapter 1",

RtfParagraphStyle.STYLE_HEADING_1), 1);

ch.addSection(new Paragraph("Section 1.1",

RtfParagraphStyle.STYLE_HEADING_2));

 

You can then use different TOC styles:

 

writer2.getDocumentSettings().registerParagraphStyle(new

RtfParagraphStyle("toc 1", "Times New Roman", 10, Font.NORMAL, Color.BLACK));

writer2.getDocumentSettings().registerParagraphStyle(new

RtfParagraphStyle("toc 2", "Times New Roman", 9, Font.NORMAL, Color.BLACK));

 

Greetings,

Mark

--

Today's weirdness is tomorrow's reason why.

            -- Hunter S. Thompson

 

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

Reply via email to