2013-05-02 62 views
1

我想在使用iText的PDF文檔中爲段落同時製作粗體和斜體文字。如何讓我的文本在iText中同時顯示爲粗體和斜體?

我可以分別使用其中任一爲粗體和斜體,但不能同時:

Font font = new Font(Font.FontFamily.TIMES_ROMAN, 10, Font.FontStyle.BOLD.ordinal());

Font font = new Font(Font.FontFamily.TIMES_ROMAN, 10, Font.FontStyle.ITALIC.ordinal());

我怎麼能同時使用?

回答

2

嘗試

Font font = new Font(Font.FontFamily.TIMES_ROMAN, 10, Font.BOLDITALIC); 
+0

感謝。有效。 – user2296988 2013-05-02 14:50:43

+0

很酷;很高興它有幫助。 – JoshDM 2013-05-02 16:18:36

相關問題