You can set the font size and style in a number of ways. I cover several of them in this article: iTextSharp - Working with Fonts.
The fact that the text appears in a table is irrelevant.
PdfPTable table = new PdfPTable(1);
PdfPCell cell = new PdfPCell(new Phrase("Cell 1", times));
table.AddCell(cell);
doc.Add(table);
It may be worth your while starting at the first of my iTextSharp articles and working your way through them. They should help you with all the basics. Start at the
bottom of this list and work your way up: http://www.mikesdotnetting.com/category/20/itextsharp
Member
18 Points
102 Posts
pdfptable how to set table font size and style
Mar 04, 2015 02:09 AM|satheeshsara|LINK
Hi,
Now only i working on pdfptable. please give me idea for how to set table and cell font size and font style.
font iTextSharp asp.net
All-Star
194527 Points
28084 Posts
Moderator
Re: pdfptable how to set table font size and style
Mar 04, 2015 02:12 AM|Mikesdotnetting|LINK
You can set the font size and style in a number of ways. I cover several of them in this article: iTextSharp - Working with Fonts. The fact that the text appears in a table is irrelevant.
font iTextSharp asp.net
Member
18 Points
102 Posts
Re: pdfptable how to set table font size and style
Mar 04, 2015 02:37 AM|satheeshsara|LINK
Sorry for my small small question
based on your article i create this font style.
BaseFont bfTimes = BaseFont.CreateFont(BaseFont.TIMES_ROMAN, BaseFont.CP1252, false);
Font times = new Font(bfTimes, 12, Font.ITALIC, Color.RED);
Then how to insert this style in pdftable?
font iTextSharp asp.net
All-Star
194527 Points
28084 Posts
Moderator
Re: pdfptable how to set table font size and style
Mar 04, 2015 03:11 AM|Mikesdotnetting|LINK
The article I wrote about using Tables shows you how to use that. iTextSharp - Introducing Tables
It may be worth your while starting at the first of my iTextSharp articles and working your way through them. They should help you with all the basics. Start at the bottom of this list and work your way up: http://www.mikesdotnetting.com/category/20/itextsharp
font iTextSharp asp.net