We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

When converting HTML to PDF does not display Russian characters

Good afternoon. Library Version 9.4.0.0

C#
string html = File.ReadAllText(Template_Path + “template.html”, Encoding.UTF8);

// instantiate Pdf object
Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf();
// specify the Character encoding for for HTML file
pdf.HtmlInfo.CharSet = “UTF-8”;
pdf.TextInfo.FontName = “Arial”;
pdf.HtmlInfo.CharsetApplyingLevelOfForce = Aspose.Pdf.Generator.HtmlInfo.CharsetApplyingForceLevel.UseWhenImpossibleDetectFromContent;
pdf.Title = “Название”;

// bind the source HTML
pdf.BindHTML(html, “”);

// save the PDF file
pdf.Save(OutPDF_Path + @“test.pdf”);

HTML




{KEY} Title\ Заголовок












test \ {тест} {KEY} - test \ тест



I am sorry, this jobs:

pdf.SetUnicode();

Hi Andrey,


Thanks for using our API.

Yes you are correct. When using Unicode (non-English) characters, you need to use the font which supports unicode characters (i.e. Arial Unicode MS) and subset the font in resultant PDF document, so that these characters are displayed properly when viewing the document.

Please continue using our API and in the event of any further query, please feel free to contact.