PDF Export Turkish Character Problem

Hi,

I am having difficulties when trying to export PDF if any Turkish characters exist such as "ş, ö, ç, ğ, ı, İ". Is there any workaround available?

For Example; 

pdfLightTable.Rows.Add(new object[] {"Üyelik Tarihi", "05.03.2018" });

PdfExport is working. But the column heading in the output is as follows: Üyelik Tarihi

Thanks..

3 Replies

KC Karthikeyan Chandrasekar Syncfusion Team October 25, 2018 10:58 AM UTC

Hi Ahmet, 
By default PdfLightTable use Standard font to draw the text in PDF document, which doesn’t support Unicode characters. To draw the Unicode characters in the PDF document use PdfTrueTypeFont. Please find below some reference links. 

Please provide us more information if your requirement is different from our understanding. So that we could guide you to get the solution. 
Regards, 
Karthikeyan  



AH Ahmet October 30, 2018 07:21 AM UTC

Finally, I was able to show the unicode chars correctly. If anyone encounter this issue later on, might use this piece of code:

var fontPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "arial.ttf");

Stream fontStream = new FileStream(fontPath, FileMode.Open, FileAccess.ReadWrite);
           
PdfTrueTypeFont font = new PdfTrueTypeFont(fontStream, 12, PdfFontStyle.Regular);  

Note; "Arial.ttf" file needs to be loaded into documents folder. 

Thanks...


KC Karthikeyan Chandrasekar Syncfusion Team October 30, 2018 10:33 AM UTC

Thank you Ahmet. 


Loader.
Up arrow icon