Changing font size in itextsharp table

血红的双手。 提交于 2019-12-04 16:11:20

Try adding font to Phrase constructors:

for (int j = 0; j < dataGridView1.Columns.Count; j++)
{
    table.AddCell(new Phrase(dataGridView1.Columns[j].HeaderText,fontTable));

}

//..

for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
    for (int k = 0; k < dataGridView1.Columns.Count; k++)
    {
         if (dataGridView1[k, i].Value != null)
         {
              table.AddCell(new Phrase(dataGridView1[k, i].Value.ToString(),fontTable));
         }
     }
}

Check this link for more info about Chunkc, Phrases etc. http://www.mikesdotnetting.com/Article/82/iTextSharp-Adding-Text-with-Chunks-Phrases-and-Paragraphs

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