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.
Syncfusion Feedback

Is it possible to generate a PDF with Polish characterset in .NET Core

Thread ID:

Created:

Updated:

Platform:

Replies:

128710 Feb 7,2017 11:25 AM UTC Feb 8,2017 12:17 PM UTC ASP.NET MVC 1
loading
Tags: PDF
Julian
Asked On February 7, 2017 11:25 AM UTC

Hi,

I've been attempting to generate a PDF that contains polish characters.

I'm using a .net core 1.1 web app with Syncfusion.Pdf.AspNet.Core v 14.4600.0.20-preview2-final

I've tried various techniques that I've found from the forum / documentation but none of them work.

1.
            var fontStream = File.OpenRead("PdfAssets/TheanoDidot-Regular.ttf");
            var headingFont = new PdfTrueTypeFont(fontStream, 20);

Throws a NotSupportedException containing inner exception - No data is available for encoding 1252. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.

2.

PdfFont font = new PdfTrueTypeFont(new Font("Arial.ttf", 14));

Seems to be from an older / different version to what I'm running - PdfTrueTypeFont constructor does not take 1 argument.


Any assistance would be greatly appreciated.



Chinnu Muniyappan [Syncfusion]
Replied On February 8, 2017 12:17 PM UTC

Hi Julian, 
 
Thank you for contacting Syncfusion support. 
 
 
I've been attempting to generate a PDF that contains polish characters. 
 
I'm using a .net core 1.1 web app with Syncfusion.Pdf.AspNet.Core v 14.4600.0.20-preview2-final 
 
I've tried various techniques that I've found from the forum / documentation but none of them work. 
 
1. 
            var fontStream = File.OpenRead("PdfAssets/TheanoDidot-Regular.ttf");
            var headingFont = new PdfTrueTypeFont(fontStream, 20);
 
 
Throws a NotSupportedException containing inner exception - No data is available for encoding 1252. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method. 
 
Yes, we have supported polish characters by using PdfTrueTypeFont in Asp.Net Core platform, however we are able to reproduce the problem with “Exception occurs while using PdfTrueTypeFont. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates 
 
2. 
 
PdfFont font = new PdfTrueTypeFont(new Font("Arial.ttf", 14)); 
Seems to be from an older / different version to what I'm running - PdfTrueTypeFont constructor does not take 1 argument. 
 
Any assistance would be greatly appreciated. 
 
PdfTrueTypeFont does not support System.Drawing.Font as an overload in Asp.Net core platform, so we have suggested you to use the anther overload for the font stream as input in PdfTrueTypeFont, Please refer the below code snippet for more details. 
 
//Load the custom font as stream 
            Stream fontStream = File.OpenRead("Font/arial.ttf"); 
 
            //Create a new PDF true type font. 
            PdfTrueTypeFont tFont = new PdfTrueTypeFont(fontStream, 12,PdfFontStyle.Regular); 
 
 
Please let us know if you have any concern. 
Regards, 
Chinnu 


CONFIRMATION

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.

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

;