How to set title font color in 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 )

+6
itext
source share
1 answer

A font is a class that contains color.

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

That should do it.

+12
source share

All Articles