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. Image for the cookie policy date

How to insert special characters to a pfdgrid?

I want to insert some characters like "■" or "Ω" as a value to one of my pdfGrid cells, like this:

            Row.Cells[1].Value = "■";

But after running the app the cell is empty, can you please help me with this issu?


5 Replies

DB Dilli Babu Nandha Gopal Syncfusion Team December 3, 2018 10:06 AM UTC

Hi Reihaneh,  
Thank you for contacting Syncfusion support.  
Yes, it is possible to draw the special characters in PdfGrid by setting the PdfGrid font as PdfTrueTypeFont. Kindly refer the below KB to preserve Unicode text in PdfGrid.  
Kindly check the above KB and let us know, if you need further assistance in this.  

Dilli babu 

RK Reihaneh Khaksaran December 18, 2018 04:29 PM UTC


Thank you so much for your reply, I followed the instructions in the given KB link, but I get null reference exception at this line of code:

Stream fontStream = typeof(MainPage).GetTypeInfo().Assembly.GetManifestResourceStream("UnicodeText.Assets.arial.ttf");
fontStream is always null!!

KC Karthikeyan Chandrasekar Syncfusion Team December 19, 2018 08:53 AM UTC

Hi Reihaneh, 
Thank you for your update.  
We are suspecting the font file (arial.ttf) build action is not set as Embedded Resource. So, the font stream becomes null and the null reference exception throws when we try to accessing.  
Kindly check, step 7 from below KB to mark the font file as Embedded Resource.  
Please try our suggestion and let us know If you need further assistance in this.  

RK Reihaneh Khaksaran December 22, 2018 03:44 PM UTC


I set the build action to "Embedded Resources", but I still get the same exception!

KK Karthik Krishnaraj Syncfusion Team December 24, 2018 01:02 PM UTC

Hi Reihaneh,  
Thank you for your update.  
In generally the null returns from the GetManifestResourceStream, when the build action is not set as embedded resource to the font file or the file path is mismatched.  
For example:  
Stream fontStream = typeof(MainPage).GetTypeInfo().Assembly.GetManifestResourceStream("UnicodeText.Assets.arial.ttf");  
Name of the current Class  
It’s the project name  
Asset folder inside the project UnicodeText  
Arial.ttf font file inside the Assets folder  
Could you please ensure the mentioned above information same in your project? For your reference, we have already shared the KB link. In the KB link there is a runnable sample  project, kindly download and run the sample in your end. If still have an issue, kindly share the sample which you are facing, we will check and resolve the issue.  

Live Chat Icon For mobile
Up arrow icon