I have two different formatted Phrase objects. The first element has a normal font style and the second is bold and italic. Now I would like to create a ListItem with those two Phrase objects. The number of the ListItem should have the same format as the second Phrase object. To realize that, I create a Paragraph that gets the Font of the second Phrase object. Then I add these two Phrase objects into the Paragraph object. After that I add this Paragraph object into the ListItem object. My problem is, that the entry is completely bold and italic. Normally the first part in the item shound be normal and the last part should be bold and italic. Any idea what I could do to create a list entry with different formatted Phrase objects, where the number of the list has the same format as the last Phrase object without overwriting the format of the phrases in front.
Enclosed my code example: PdfWriter.getInstance(document,new FileOutputStream("Test.pdf")); document.open(); Font[] fonts = new Font[2]; fonts[0] = new Font(Font.TIMES_ROMAN, 14, Font.NORMAL); fonts[1] = new Font(Font.TIMES_ROMAN, 14, Font.BOLD | Font.ITALIC); Chunk chunk1 = new Chunk("Test_Bold_And_Italic", fonts[0]); Phrase phrase1 = new Phrase(); phrase1.add(chunk1); Chunk chunk2 = new Chunk("Test_Normal", fonts[1]); Phrase phrase2 = new Phrase(); phrase2.add(chunk2); Paragraph par = new Paragraph("", chunk2.getFont()); par.add(phrase1); par.add(phrase2); List list = new List(List.ORDERED, List.NUMERICAL, 18); list.setFirst(1); ListItem item = new ListItem(par); list.add(item); document.add(list); ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/