Free Support Forum - aspose.com

?-?-?-? turkish characters problem

Hi i want to convert html file to pdf file, i can create the pdf file but some turkish characters like “ı,ş,Ş,ğ” does not displayed in pdf. How can i fix this problem ? (I attached html(with txt extension) and pdf file)


My code for pdf generation :

Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf();
// add the section to PDF document sections collection
Aspose.Pdf.Generator.Section section = pdf.Sections.Add();

// Read the contents of HTML file into StreamReader object
StreamReader r = File.OpenText(fileName);

//Create text paragraphs containing HTML text
Aspose.Pdf.Generator.Text text2 = new Aspose.Pdf.Generator.Text(section, r.ReadToEnd());
// enable the property to display HTML contents within their own formatting
text2.IsHtmlTagSupported = true;
//Add the text paragraphs containing HTML text to the section
section.Paragraphs.Add(text2);
//Save the pdf document
pdf.Save(outputPath);

r.Dispose();
r.Close();





Hi Yunus,


Thanks for your inquiry. To enable unicode character support please set TexInfo property as following. It will resolve the issue. Please find attached sample output Pdf.

text2.TextInfo.IsUnicode = true;
Please feel free to contact us for any further assistance.

Best Regards,

thank you very much