Change font of the generated number for Numbered List in RTF 2006-07-29 - By Venu Reddy
Back Hi,
I am creating a RTF document with numbered list. I am able to generate the numbered list but the generated number Font is different than the font of the ListItem. So my question is how can I set the font of the generated number same as listItem?
Below is my test code
public StringBuffer generate() { Document document = new Document(); try { RtfWriter2.getInstance(document, new FileOutputStream("D:/projects /itextTest/temp.rtf")); document.open(); Paragraph paragraph = new Paragraph(); paragraph.add(Chunk.NEWLINE); paragraph.add(getList()); document.add(paragraph); document.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (DocumentException e) { e.printStackTrace(); } return null; }
public List getList() { RtfFont rtfFont = new RtfFont("Arial", 10); List list = new List(true, 20); list.add(new ListItem("1st Line \n", rtfFont)); list.add(new ListItem("2nd Line \n", rtfFont)); list.add(new ListItem("3rd Line \n", rtfFont)); return list; }
Out put of the above code, the text font is "Arial" but the numbers font is "Times New Roman".
1. 1st Line
2. 2nd Line
3. 3rd Line
Help is greatly appreciated. Thanks
-- India.com free e-mail - www.india.com. Check out our value-added Premium features, such as an extra 20MB for mail storage, POP3, e-mail forwarding, and ads-free mailboxes!
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- 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@(protected) https://lists.sourceforge.net/lists/listinfo/itext-questions
|
|