Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set header font color in iText

Tags:

itext

HeaderFooter header = 
      new HeaderFooter(new Phrase("test", new Font(bf_times)), false);
header.setAlignment(Element.ALIGN_CENTER);
header.setBackgroundColor(new Color(0xB5091E));

document.setHeader(header);

I want to set the Font color for test to white (FFFFFF)

like image 761
learn_plsql Avatar asked Aug 11 '10 17:08

learn_plsql


1 Answers

The Font is the class holding the color.

Font font = new Font(bf_times)
font.setColor(Color.WHITE);

This should do it.

like image 78
Jes Avatar answered Jan 04 '23 04:01

Jes