I want to pass the text of a richTextBox from Visual Studio (c#) to a .pdf file, using iTextSharp. My code does create the .pdf file and the text is passed on the file. However, the Greek words - characters included do not appear in the text of the file (only english characters, numbers and symbols eg. dash etc do). I understand I need somehow need to alter the default base-font to some other, so that the Greek letters can also show up, and have tried numerous suggestions I have come across, but still can't make it work. Here is my code:
SaveFileDialog sfd = new SaveFileDialog();
private void button1_Click(object sender, EventArgs e)
{
sfd.Title = "Save As PDF";
sfd.Filter = "(*.pdf)|*.pdf";
sfd.InitialDirectory = @"C:\";
if (sfd.ShowDialog() == DialogResult.OK)
{
iTextSharp.text.Document doc = new iTextSharp.text.Document();
PdfWriter.GetInstance(doc, new FileStream(sfd.FileName, FileMode.Create));
doc.Open();
doc.Add(new iTextSharp.text.Paragraph(richTextBox1.Text));
doc.Close();
}
}