Hi,
I am creating a Numbered List in RTF using iText. It generates the list properly but the numbering is in different font i.e.., "Times New Roman" and text is in "Arial". The question is how do I set uniform font for the list for both generated numbers and list text?
Help is greatly appreciated. I have posted the same question in iText mailing list.
Here is my code
Output of the code in Rtf, 1,2,3 are in TimeNewRoman and the text is in Arial. I want to make both the numbers and text use Arial font.
1. 1st Item
2. 2nd Item
3. 3rd Item
Thanks
Gorge
I am creating a Numbered List in RTF using iText. It generates the list properly but the numbering is in different font i.e.., "Times New Roman" and text is in "Arial". The question is how do I set uniform font for the list for both generated numbers and list text?
Help is greatly appreciated. I have posted the same question in iText mailing list.
Here is my code
Code:
public StringBuffer generate() {
Document document = new Document(PageSize.LETTER, 50, 50, 50, 50);
try {
RtfWriter2.getInstance(document, new FileOutputStream("c:/testRTFdocument.rtf"));
document.open();
RtfFont rtfFont = new RtfFont("Arial", 10);
Paragraph paragraph = new Paragraph("", rtfFont);
document.add(Chunk.NEWLINE);
paragraph.add(getNumberedList());
document.add(paragraph);
document.close();
} catch (FileNotFoundException e) {
logger.error(e.toString(), e);
} catch (DocumentException e) {
logger.error(e.toString(), e);
}
return null;
}
public List getNumberedList(){
RtfFont rtfFont = new RtfFont("Arial", 10);
List list = new List(true, 20);
list.add(new ListItem("1st Item\n", rtfFont));
list.add(new ListItem("2nd Item\n", rtfFont));
list.add(new ListItem("3rd Item\n", rtfFont));
return list;
}
Output of the code in Rtf, 1,2,3 are in TimeNewRoman and the text is in Arial. I want to make both the numbers and text use Arial font.
1. 1st Item
2. 2nd Item
3. 3rd Item
Thanks
Gorge