public void PersianSupport(string sFilePDF)
{
Document document = new Document();
try
{
PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(sFilePDF, FileMode.Create));
document.Open();
string fontpath = Environment.GetEnvironmentVariable("SystemRoot") + "\\fonts\\times.ttf";
BaseFont basefont = BaseFont.CreateFont(fontpath, BaseFont.IDENTITY_H, true);
iTextSharp.text.Font arabicFont = new iTextSharp.text.Font(basefont, 24, iTextSharp.text.Font.NORMAL, iTextSharp.text.Color.BLUE);
var el = new Chunk();
iTextSharp.text.Font f2 = new iTextSharp.text.Font(basefont, el.Font.Size,
el.Font.Style, el.Font.Color);
el.Font = f2;
PdfPTable table = new PdfPTable(1);
table.RunDirection = PdfWriter.RUN_DIRECTION_RTL;
var str = "نام : " ;
PdfPCell cell = new PdfPCell(new Phrase(10, str, el.Font));
table.AddCell(cell);
document.Add(table);
document.Close();
}
catch (DocumentException de)
{
}
catch (IOException ioe)
{
}
document.Close();
}