BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Hi Ivan,
Thank you for using syncfusion products,
Currently we are not supporting the Unicode characters in Syncfusion xamarin PDF, we have logged the feature request internally, and we will update you once the feature has been implemented.
Please let us know if you need further assistance.
With Regards,
Praveen
Hi Ivan,
A quick notes on previous update, the feature for supporting the Unicode characters in xamarin platform will be available in our next Syncfusion xamarin refresh release.
Please let us know if you need further assistance.
With Regards,
Praveen
Stream fontStream = typeof(MainActivity).GetTypeInfo().Assembly.GetManifestResourceStream("PDFFormTesting.Assets.ArialUnicodeMS.ttf");
//loading true type font
PdfTrueTypeFont font = new PdfTrueTypeFont(fontStream, 24);
PdfDocument doc = new PdfDocument();
PdfPage page = doc.Pages.Add();
//drawing string
page.Graphics.DrawString("Наименование", font, PdfBrushes.Red, 0, 0);
Please try the above code snippet and let us know your result.
With Regards,
Praveen
//Create new PDF document.
PdfDocument doc = new PdfDocument();
//Add page to the PDF document.
PdfPage page = doc.Pages.Add();
//Get font from device using Skia Sharp.
Stream fontStream = GetFontStream("Arial Unicode Ms");
//Create new PdfTrueTypeFont instance.
PdfTrueTypeFont font = new PdfTrueTypeFont(fontStream, 12);
//Draw text.
page.Graphics.DrawString("Наименование", font, PdfBrushes.Black, PointF.Empty);
MemoryStream stream = new MemoryStream();
//Save the PDF document
doc.Save(stream);
//Close the PDF document
doc.Close(true);
|
private Stream GetFontStream(string fontName)
{
SKTypeface typeface = SKTypeface.FromFamilyName(fontName, SKTypefaceStyle.Normal);
SKStreamAsset stream = typeface.OpenStream();
if (stream != null && stream.Length > 0)
{
byte[] fontData = new byte[stream.Length - 1];
stream.Read(fontData, stream.Length);
stream.Dispose();
return new MemoryStream(fontData);
}
else
return null;
}
|