How to set a custom color in itext?

送分小仙女□ 提交于 2019-12-04 03:21:38
Mark

You'll need to take your 8-bit hexadecimal color value and convert it to 8-bit RGB values.

How to convert hex to rgb using Java?

Then you'll be able to create a new BaseColor with your RGB values.

cell.setBackgroundColor(new BaseColor(255, 0, 0));

Take a look at this site. Even though it says C# there are only Java codes. Let me know if you find it or not. I created an successful PDF system looking at those examples.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!