Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Define foreground color of a itextsharp table cell

Tags:

c#

itextsharp

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?

like image 909
CKDT Avatar asked Apr 27 '11 15:04

CKDT


1 Answers

Try the following

    var FontColour = new BaseColor(31, 73, 125);
    var MyFont = FontFactory.GetFont("Times New Roman", 11, FontColour );
    table.AddCell(new Paragraph("My Text", MyFont));
like image 63
Michal Ciechan Avatar answered Oct 20 '22 23:10

Michal Ciechan