定义itextsharp表格单元格的前景色 [英] Define foreground color of a itextsharp table cell

查看:129
本文介绍了定义itextsharp表格单元格的前景色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个iTextSharp.text.Table并尝试更改前景文字颜色。但是Cell对象上没有方法来定义颜色。有谁知道,我可以在哪里调整颜色?

I have a iTextSharp.text.Table and tried to change the foreground text color. But there is no method on the Cell object to define the color. Does anybody knows, where I can adjust the color?

推荐答案

试试以下

    var FontColour = new BaseColor(31, 73, 125);
    var MyFont = FontFactory.GetFont("Times New Roman", 11, FontColour );
    table.AddCell(new Paragraph("My Text", MyFont));

这篇关于定义itextsharp表格单元格的前景色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆