开发者

how to set header font color in iText

开发者 https://www.devze.com 2023-01-10 23:16 出处:网络
HeaderFooter header = new HeaderFooter(new Phrase(\"test\", new Font(bf_times)), false); header.set开发者_如何转开发Alignment(Element.ALIGN_CENTER);
HeaderFooter header = 
      new HeaderFooter(new Phrase("test", new Font(bf_times)), false);
header.set开发者_如何转开发Alignment(Element.ALIGN_CENTER);
header.setBackgroundColor(new Color(0xB5091E));

document.setHeader(header);

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


The Font is the class holding the color.

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

This should do it.

0

精彩评论

暂无评论...
验证码 换一张
取 消