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
close icon
Starting in 2019, the Reporting control is no longer included in Essential Studio. If you're experiencing issues with the Syncfusion Reporting Platform, Report Viewer, Report Designer, or Report Writer, we recommend migrating to Bold Reports, our dedicated reporting platform.

Bold Reports offers a comprehensive suite of tools and features for all your reporting needs, and we will help you make a smooth transition from the discontinued control. Our support team at https://support.boldreports.com/ is here to assist you with any questions or difficulties you may encounter during the migration process.

We thank you for choosing Syncfusion and appreciate your understanding.

Printing PDF from RDLC changes font

Hello,

 

I am printing from a RDLC report and the font selected, Segoe UI, is actually printing in Times New Roman.  I've attached some screenshots to illustrate the issue.

 

The pdfViewer variable is a SfPdfViewerControl object.

 

This is the code I use to generate the PDF:

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

            Stream reportStream = assembly.GetManifestResourceStream("Report.rdlc");

            ReportWriter writer = new ReportWriter();

            writer.ReportProcessingMode = Syncfusion.ReportWriter.ProcessingMode.Local;

            writer.DataSources.Clear();

            writer.DataSources.Add(new ReportDataSource { Name = "Data", Value = PopulateData() });

            writer.LoadReport(reportStream);

 

            MemoryStream stream = new MemoryStream();

            writer.Save(stream, WriterFormat.PDF);

 

            // A zero length stream just causes the LoadDocument to hang.

            if (stream.Length > 0)

            {

                await pdfViewer.LoadDocumentAsync(new PdfLoadedDocument(stream));

            }

 

This is the code I use to print the pdf:

            pdfViewer.Print();

 

Any idea how to get my print outs to actually print in the Segoe UI font I have selected instead of Times New Roman?

 

Thank you,

Michael

Attachment: Issue_Files_b5a312f5.zip

6 Replies

PP Praveena P Syncfusion Team July 8, 2016 12:16 PM UTC

Hi Michael, 
 
As UWP platform does not provide access to the installed font data in the system, Unicode fonts such as “Segoe UI” cannot be embedded directly in exported PDF document. Hence need to add required Unicode font files as an embedded resource to the document for the display and print of text using the appropriate font. The Unicode font streams need to be added to the Report Writer’s PDF Fonts collection to export report as PDF format with Unicode fonts as shown in the below code snippet.  

writer.PDFFonts = new Dictionary<stringStream>(StringComparer.OrdinalIgnoreCase);  
writer.PDFFonts.Add("Segoe UI", assembly.GetManifestResourceStream("UWPwriterSample.Assets.Segoe_UI.ttf"));  
 
Please find the sample attached in the below link which illustrates how to add required Unicode font files as an embedded resource to the application. 
 
And also attached printed output document in OXPS format which contains Segoe UI font printed using PdfViewer and it displays as Segoe UI font. 
 
Please let me know if you have any concerns. 
Regards, 
Praveena 
 



SD Spartan Developer July 8, 2016 02:07 PM UTC

Hello, 

That works well!

Thank you,
Michael


PP Praveena P Syncfusion Team July 11, 2016 09:58 AM UTC

Hi Michael , 
We are glad to know that your issue has been resolved. Please let us know if you need any further assistance.    
Regards, 
Praveena 



TI Tinh June 30, 2020 03:36 AM UTC

Dear Syncfusion Team,
I have the problem with Times New Roman (Vietnamese font) when I use reportwriter to export to pdf file. But I export to Word and Excel it not error.
Please help me check this problem and feedback me soon. 

Attachment: FontError_eb34a9e3.zip


TI Tinh June 30, 2020 03:46 AM UTC

I just updated the images.

My Code: 
Word file:

PDF file:



MS Muthuramana Sankaranarayanan Syncfusion Team July 1, 2020 10:04 AM UTC

Hi Michael, 

We checked the reported issue and we were unable to reproduce it. Is it possible for you to share us the report and the font file, as it will be helpful for us to validate it from our end. 

Regards, 
Muthu Ramana S 


Loader.
Live Chat Icon For mobile
Up arrow icon