Text is broken when exporting pdf of sfdatagrid.

I use Hangul.
Hangul is broken when exporting pdf from sfdatagrid.
(English is good.)
It seems to be an encoding problem.
Is there a way to change the encoding while exporting pdf?

9 Replies 1 reply marked as answer

MA Mohanram Anbukkarasu Syncfusion Team June 9, 2021 10:06 AM UTC

Hi nam ki hun, 

Thanks for contacting Syncfusion support.  

We are little unclear about the reported issue and the text script used in your application. If possible kindly provide an example hangul scripts used in your application and an image reference for the issue you are facing while exporting it to PDF. It will be more helpful for us to replicate the issue in our end. So that we can check for cause for the issue and provide a prompt solution.  

Regards, 
Mohanram A. 



NK nam ki hun June 15, 2021 01:15 AM UTC

this is my code.

PdfExportingOptions options = new PdfExportingOptions();
options.FitAllColumnsInOnePage = true;
options.RepeatHeaders = true;
var document = sfDataGridAnalysisMessage.ExportToPdf(options);
document.Save(fileName);

And this is the result.



I use Hangul.
The Hangul part is all broken.
I think it's an encoding problem.
I want to change the encoding, but I don't know how.
I need your help.



MA Mohanram Anbukkarasu Syncfusion Team June 15, 2021 06:57 AM UTC

Hi nam ki hun, 

Thanks for the update. 

As we mentioned in our previous update, we are unclear about the Hangul text script used in your application. However we have prepared a sample to replicate your scenario and it is available in the following link.  


In this sample, if we export the DataGrid to PDF, the specific column with the different text script is empty in the exported pdf document. Please have a look at this sample and confirm whether this is the issue you are facing in your end. We will check and update with further details based on your confirmation.  

Regards, 
Mohanram A. 



NK nam ki hun June 16, 2021 09:19 AM UTC


This is the result of running your sample code.
I found the same problem.
As in the capture picture, the hangle part is empty.

See the previously uploaded capture picture.
My sample result is almost empty, and intermittently "?" is displayed.
Isn't it an encoding issue?


MA Mohanram Anbukkarasu Syncfusion Team June 17, 2021 01:12 PM UTC

Hi nam ki hun, 

Thanks for the update.  

We are currently validating the reported issue. We two more business days to validate this properly. We will update with further details on June 21, 2021. We appreciate your patience until then.  

Regards, 
Mohanram A. 



MA Mohanram Anbukkarasu Syncfusion Team June 21, 2021 12:35 PM UTC

Hi nam ki hun, 

We regret for the inconvenience. 

We have checked the reported issue in our end. It seems the issue occurs in the PDFGrid. We have forwarded this to the corresponding team for analysis. We will update with further details on June 23, 2021. We appreciate your patience and understanding.  

Regards, 
Mohanram A. 



MA Mohanram Anbukkarasu Syncfusion Team June 23, 2021 08:51 AM UTC

Hi nam ki hun, 

Thanks for your patience.  

You can resolve the problem in exporting Hangul text by setting appropriate font while exporting the DataGrid as shown in the following code example.  

Code example :  

private void button1_Click(object sender, EventArgs e) 
{ 
    var options = new PdfExportingOptions(); 
    options.Exporting += Options_Exporting; 
    var document = sfDataGrid1.ExportToPdf(sfDataGrid1.View, options); 
    document.Save("Sample.pdf"); 
    System.Diagnostics.Process.Start(@"Sample.pdf"); 
} 
 
private void Options_Exporting(object sender, Syncfusion.WinForms.DataGridConverter.Events.DataGridPdfExportingEventArgs e) 
{ 
    PdfCjkStandardFont cjkFont = new PdfCjkStandardFont(PdfCjkFontFamily.HanyangSystemsShinMyeongJoMedium, 8, PdfFontStyle.Regular); 
    e.CellStyle.Font = cjkFont; 
} 


Please let us know if you require any other assistance from us.  

Regards, 
Mohanram A. 


Marked as answer

NK nam ki hun June 25, 2021 08:23 AM UTC

Perfectly solved.

Thank you sincerely.


Regards,

Ki Hun.



MA Mohanram Anbukkarasu Syncfusion Team June 25, 2021 11:41 AM UTC

Hi nam ki hun,  

Thanks for the update. 

We are glad to know that the provided solution worked at your end. Please let us know if you require any other assistance from us. We are happy to help you. 

Regards,  
Mohanram A 


Loader.
Up arrow icon