public void SetPdf()
{
PdfPTable PdfTable = new PdfPTable(GridView2.HeaderRow.Cells.Count);
//BaseFont bfTimes = BaseFont.CreateFont("c:/windows/fonts/arial.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
//iTextSharp.text.Font _standardFont = new iTextSharp.text.Font(iTextSharp.text.Font.FontFamily.HELVETICA, 8, iTextSharp.text.Font.NORMAL, BaseColor.BLACK);
BaseFont bfTimes = BaseFont.CreateFont("c:/windows/fonts/arial.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
Font fuente = new Font(bfTimes, 7);
foreach (GridViewRow gridViewRow in GridView2.Rows)
{
foreach (TableCell tableCell in gridViewRow.Cells)
{
String texto = HttpUtility.HtmlDecode(tableCell.Text);
Phrase p = new Phrase(texto, fuente);
p.Add(new VerticalPositionMark());
PdfPCell pdfCell = new PdfPCell(p);
pdfCell.BorderWidthBottom = 0f;
pdfCell.BorderWidthLeft = 0f;
pdfCell.BorderWidthTop = 0f;
pdfCell.BorderWidthRight = 0f;
PdfTable.AddCell(pdfCell);
}
}
Session["pdf"] = PdfTable;
}