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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

PDF cannot render strings in some languages (Chinese simplified, Japanese)

Thread ID:





126942 Oct 17,2016 05:30 PM UTC Jun 5,2017 06:16 AM UTC Xamarin.Forms 5
Tags: PDF
Jeff Lindborg
Asked On October 17, 2016 05:30 PM UTC

using the PdfGraphics "DrawSring" method, I'm passing in a unicode string that looks like this (for Chinese simplified):

过去 7 天内的血糖平均 : 111.37 mg/dL

this renders properly everywhere, including on the graph titles and axis and such, but the PDF control only allows for 5 fonts to be passed to the DrawString as the PdfFont parameter - I tried all 5 and the above string renders in the PDF output as:

7 : 111.37 mg/dL

For other languages like German, French, Spanish etc... it renders fine, of course - just graphical languages that require special fonts - Word uses "Microsoft JhengHei" for this, it can also use "MS Gothic" and the like.  

Just checking if there's something simple I'm missing or if the PDF component does not support rendering strings for all languages.


Sasi Kumar Sekar [Syncfusion]
Replied On October 18, 2016 02:20 PM UTC

Hi Jeff, 

Thank you for contacting Syncfusion support, 

We can draw the text using different font using the PdfTruetypeFont, please find the below code snippet to load the different font file to PdfTrueTypeFont to draw the string. 
Stream fontStream = typeof(App).GetTypeInfo().Assembly.GetManifestResourceStream("jhenghei.ttf");  PdfTrueTypeFont font = new PdfTrueTypeFont(fontStream, 12); 
page.Graphics.DrawString("过去 7 天内的血糖平均", font, PdfBrushes.Black, new PointF(10, 10)); 

We have created the sample to preserve the given Chinese character by mentioned  JhengHei TrueType Font file. Please find the sample link below for your reference. 
Sample link: 

Please let us know if you have need further assistance. 
Sasi kumar S. 

Jeff Lindborg
Replied On October 18, 2016 04:16 PM UTC

cool - the arialuni.ttf font included in your sample project works for all languages I tried it against (Hindi, Arabic, Japanese, Chinese simplified) - so that will work out find.

thanks much.

Sasi Kumar Sekar [Syncfusion]
Replied On October 19, 2016 07:16 AM UTC

Hi Jeff, 
Thank you for your update, 
Please let us know if you need further assistance. 
Sasi kumar S. 

Slobodan Babic
Replied On June 2, 2017 11:24 AM UTC

I am having a similar issue while working with PDF files, only difference is that contain text form fields - some specific Unicode characters are not rendering properly when using PdfStandardFont.
Can I somehow set the font property for textual form field, and then use PdfTrueTypeFont that I obtained from resources for fields?

Sasi Kumar Sekar [Syncfusion]
Replied On June 5, 2017 06:16 AM UTC

Hi Jeff, 
Thank you for your update, 
In default the PDF Standard fonts is not supported for all Unicode characters, we have preferred the Truetype fonts to preserve the Unicode characters. Please find the UG documentation link for embedding and working with the Unicode character. 
UG documentation link: 
We can set the font for the specific form field by using the Font property. Please find the code snippet to set font to the form field. 
Code snippet: 
//Create a new PDF document. 
PdfDocument document = new PdfDocument(); 
//Add a new page to the PDF document. 
PdfPage page = document.Pages.Add(); 
//Create a textbox field and add the properties. 
PdfTextBoxField textBoxField = new PdfTextBoxField(page, "CompanyName"); 
Stream fontStream = typeof(App).GetTypeInfo().Assembly.GetManifestResourceStream("jhenghei.ttf"); 
PdfTrueTypeFont font = new PdfTrueTypeFont(fontStream, 12);  
//Set the font to the form field. 
textBoxField.Font = font; 
textBoxField.Text = "Syncfusion"; 
textBoxField.Bounds = new RectangleF(0, 0, 100, 20); 
textBoxField.ToolTip = "First Name"; 
//Add the form field to the document. 
MemoryStream stream = new MemoryStream(); 
Please let us know If you need further assistance in this. 
Sasi Kumar S. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon