At this point, PDF export of charts is not supported for .NET Standard.
You can export spreadsheet documents in RadSpreadProcessing using the PdfFormatProvider class. The charts functionality relies on a renderer which implements the IPdfChartRenderer interface to draw the charts in the PDF document. This topic shows how you can implement this renderer using the built-in class in WPF.
To use the functionality described in this topic, you will need to add a reference to the Telerik.Windows.Controls.Spreadsheet.dll and Telerik.Windows.Controls.Chart.dll assemblies of the Telerik UI for WPF suite.
The IPdfChartRenderer interface defines members for classes which will be used by the internal logic of PdfFormatProvider to render the chart objects in a spreadsheet document when exporting it to PDF. The interface defines the RenderChart() method which should be implemented so it can be called when the internal logic of the PdfFormatProvider reaches a chart which has to be rendered.
The ChartModelToImageConverter object is readily available in the Telerik.Windows.Controls.Spreadsheet assembly and uses internally the RadChartView control to visualize the chart and create an image. This class exposes the GetBitmapSourceFromFloatingChartShape() method which converts a chart shape object to an image and can be used to draw the image in the PDF document.
The PdfFormatProvider instance accepts a renderer in its settings. The renderer needs to implement the IPdfChartRenderer interface and the RenderChart() method this interface defines. The method takes a FixedContentEditor in its parameters, which will draw the chart, and the other parameters contain the information necessary to draw it. The WpfPdfChartImageRenderer implemented in Example 1 is an example implementation which uses the Telerik.Windows.Controls.Spreadsheet and Telerik.Windows.Controls.Chart assemblies to draw the chart.
Example 1: Implementing a renderer
public class WpfPdfChartImageRenderer : IPdfChartRenderer
private readonly ChartModelToImageConverter chartToImageConverter;
this.chartToImageConverter = new ChartModelToImageConverter();
// This is the method which will be called when the internal logic of the PdfFormatProvider reaches a chart which has to be rendered.
public void RenderChart(FixedContentEditor editor, FloatingChartShape chartShape)
// The ChartModelToImageConverter object is readily available in the Telerik.Windows.Controls.Spreadsheet assembly and
// uses internally the RadChartView control to visualize the chart and create an image.
BitmapSource source = this.chartToImageConverter.GetBitmapSourceFromFloatingChartShape(chartShape);
// The editor draws the image in the PDF.
public Stream StreamFromBitmapSource(BitmapSource writeBmp)
Stream bmp = new MemoryStream();
BitmapEncoder enc = new BmpBitmapEncoder();
Example 2: Registering the renderer
PdfFormatProvider pdfFormatProvider = new PdfFormatProvider();
pdfFormatProvider.ExportSettings.ChartRenderer = new WpfPdfChartImageRenderer();
You can find a complete runnable example using the approach described in this topic in our SDK repository: Export Chart.