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

Free Support Forum - aspose.com

How to encode Chinese characters in Latest .net version of aspose PDF

Hi,
We are using Latest licensed version of .Net aspose pdf 21.6.0. We are facing issue with encoding Chinese characters after rendering we are getting sqaure boxes. We have used HTMLFragment class to render both HTML Content and Chinese text content and generating PDF format but Chinese characters are not displayed properly. Please do needful.

@dhanu.tpk

Please use the latest version of Aspose.PDF for .NET 22.4. Hope this helps you.

If you still face problem, please attach the following resources here for testing:

  • Your input PDF file.
  • Please attach the output file that shows the undesired behavior.
  • Please attach the expected output file that shows the desired behavior.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

netcoreapp3.1ChineseIssue.pdf (348.0 KB)

We have tried with latest version of aspose PDF 22.4.0 still we are facing same issue. Chinese characters are not rendered properly, square boxes are displayed. Please find the uploaded attachments. earlier it was working fine with 16.11.0 version. now it is broken after we upgrade to latest version.

        Document doc = new Document();
        var defaultFontName = "HP simplified hans regular";
        var termsandConditions = new HtmlFragment("<div style = 'font-family:" + defaultFontName + ",'Arial Unicode MS';font-size:12px' ><input type='checkbox' /><strong>条款和条件</strong>:请点击条款和条件复选框.</div>");
        doc.Pages.Add().Paragraphs.Add(termsandConditions);
        var dataDir = Environment.CurrentDirectory;
        doc.Save(dataDir + "ChineseIssue.pdf");

@dhanu.tpk

We have logged this problem in our issue tracking system as PDFNET-51754. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.