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.
Unfortunately, activation email could not send to your email. Please try again.

How to display unicode text in Pdf WinRt

How to display Unicode text in Pdf document in WinRT platform

 

Essential PDF does not provide direct support for rendering Unicode text in WinRT platform. As WinRT does not provide access to installed font data, Unicode fonts cannot be embedded directly. Instead, the font file can be added as an embedded resource to the application, from where it can be embedded in the PDF Document.

You can use the PdfTrueTypeFont to display the Unicode font in the PDF, Please refer the below code snippet.

[C#]

 

Assembly assembly = typeof(MainPage).GetTypeInfo().Assembly;

//Gettin the fontdata

Stream fontData = assembly.GetManifestResourceStream("PdfUnicodeFontSample.Assets.arial.ttf");

//creating the docuement

PdfDocument document = new PdfDocument();

PdfPage page = document.Pages.Add();

//creating the true type font

PdfTrueTypeFont font = new PdfTrueTypeFont(fontData, 20);

//drawing the string

page.Graphics.DrawString("Sample@#% unicode test%3^*", font, PdfBrushes.Red, 0, 0);

 

MemoryStream stream = new MemoryStream();

//saving the document

document.Save(stream);

 

Save(stream);

 

 

Sample:

The below sample shows how to add a font file as embedded resource and how the Unicode text can be drawn to the PDF document.

http://www.syncfusion.com/downloads/support/directtrac/general/PdfUnicodeFontSample1174984094.zip

Article ID: Published Date: Last Revised Date: Platform: Control:
2650 11/13/2014 11/13/2014 WinRT PDF
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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.