2

I am trying to make my text both bold and italic at the same time for a paragraph in a PDF document using iText.

I can use either of these for bold and italic respectively, but not both simultaneously:

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());

How can I use both?

javaAndBeyond
  • 520
  • 1
  • 9
  • 26

1 Answers1

4

Try

Font font = new Font(Font.FontFamily.TIMES_ROMAN, 10, Font.BOLDITALIC);
JoshDM
  • 4,939
  • 7
  • 43
  • 72