BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
We are
trying to generate pdf in UWP application using PDF API.
And the
need is that the Unicode characters should be able to be written to the PDF
from the application. Can you please let us know whether multilingual Unicode
characters are supported with PDF API from UWP.
Thanks in
Advance for any inputs on this.
//Load the true type font.
Stream fontstream = typeof(MainPage).GetTypeInfo().Assembly.GetManifestResourceStream("App1.Assets.arial.ttf");
//Create a new PDF document.
PdfDocument doc = new PdfDocument();
//Add a new page.
PdfPage page = doc.Pages.Add();
//Initialize the PDF true type font.
PdfFont font = new PdfTrueTypeFont(fontstream, 12, PdfFontStyle.Regular);
//Draw text.
page.Graphics.DrawString("hello world! @ # €", font, PdfBrushes.Black, new System.Drawing.PointF(0, 0)); |
Where do these true type fonts come from that are referenced in the example. There is never any instructions on where they come from. Are they provided from Syncfusion?
Hi john,
The TrueTypeFont class is Syncfusion API. We can add text using the font file from local file system by providing the path of the TrueType font location. Please refer to the below documentation link for more information,
We need to referred the suitable font file to Assert folder. Please
refer the step 5 of below KB documentation for adding font file to the Assert folder and set the Build Action to Embedded Resource,
https://www.syncfusion.com/kb/9722/how-to-draw-the-euro-symbol-in-a-pdf-in-uwp
Please let us know if you need any further assistance in this.
Regards,
Gowthamraj K
If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.