pdfptable how to set table font size and style RRS feed

  • Question

  • User1472402676 posted


    Now only i working on pdfptable. please give me idea for  how to set table and cell font size and font style.

    Wednesday, March 4, 2015 2:09 AM

All replies

  • User-821857111 posted

    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.

    Wednesday, March 4, 2015 2:12 AM
  • User1472402676 posted

    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?

    Wednesday, March 4, 2015 2:37 AM
  • User-821857111 posted

    The article I wrote about using Tables shows you how to use that. iTextSharp - Introducing Tables

    PdfPTable table = new PdfPTable(1);
    PdfPCell cell = new PdfPCell(new Phrase("Cell 1", times));

    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

    Wednesday, March 4, 2015 3:11 AM