We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Text with Greek Letters

How can I display greek letters properly? The intended text appears in the pdf file as

ÊáñôÝëåò.

3 Replies

SS Sri Subhashini M Syncfusion Team September 9, 2009 08:47 AM UTC

Hi Theodore,

Thank you for your interest in Essential PDF.

Drawing Greek string in PDF

We can draw the greek language text by drawing the text with PdfTrueType font. Kindly refer the below code snippet,


//Create font
Font f = new Font("Arial", 14);
PdfFont font = new PdfTrueTypeFont(f, true);
string path = @"..\..\Data\Essential PDF.rtf";

//Read the text from text file
StreamReader reader = new StreamReader("Greek.txt", Encoding.Unicode);
string text = reader.ReadToEnd();
reader.Close();

//Create a brush
PdfBrush brush = new PdfSolidBrush(Color.Black);
PdfPen pen = new PdfPen(Color.Black);
SizeF clipBounds = page.Graphics.ClientSize;
RectangleF rect = new RectangleF(0, 0, clipBounds.Width , clipBounds.Height);

//Set the property for RTL text
PdfStringFormat format = new PdfStringFormat();
format.ParagraphIndent = 35f;
page.Graphics.DrawString(text, font, brush, rect, format);


Could you please do find the sample which demonstrates the above mentioned feature and let me know if you need any information?


http://files.syncfusion.com/samples/PDF.Windows/GreekSupport.zip

Regards,
Suba


AD Administrator Syncfusion Team September 9, 2009 10:17 AM UTC

Thank you for your promt response.

It works as expected.


SS Sri Subhashini M Syncfusion Team September 11, 2009 06:06 AM UTC

Hi Theodore,

Glad to hear that it worked fine.

Please let me know if you need any further assistance.

Regards,
Suba

Loader.
Live Chat Icon For mobile
Up arrow icon