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);
我想将
test
的字体颜色设置为白色(FFFFFF
)
最佳答案
字体是保存颜色的类。
Font font = new Font(bf_times)
font.setColor(Color.WHITE);
这应该做。
关于itext - 如何在iText中设置标题字体颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3460955/