SfDataGrid exports data to PDF using . By default, some fonts (such as Unicode font) are not supported in PDF. In this case, it is possible to embed the font in PDF document with the help of PdfTrueTypeFont.
Here, you can see how to embed font into the PDF document. In SfDataGrid, you can customize the content that is to be exported into PDF, by using delegate handlers in the PdfExportingOptions.
The following code illustrates how to set the event to ExportingEventHandler delegate of PdfExportingOptions where you can embed Font.
The following code illustrates how to create a font from the resource file and embed into the font of PdfGridCell cell style in WinRT.
In Silverlight, you can render the stream by using GetResourceStream() method to retrieve the font from the resource file and embed into the font of PdfGridCell cell style as illustrated in the following code example.
In the above code, unicode font embeds into PDF. Therefore, exporting the SfDataGrid with Unicode character “€” is exported to PDF correctly.
Figure 1: SfDataGrid
Following is the exported PDF document with Unicode character.
Figure 2: Exported PDF
You can refer to the following sample links for exporting unsupported fonts from SfDataGrid to PDF document in WPF, WinRT and Silverlight.
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:|