Skip to main content
A newer version of this page is available. .

How to: Export a Chart to PDF

The following example demonstrates how to export the chart’s data as a PDF document either to a file or to a stream.

using System.IO;
// ...

if (chartControl1.IsPrintingAvailable){
   // Exports to a PDF file.
   chartControl1.ExportToPdf("Output.pdf");

   // Exports to a stream as PDF.
   FileStream pdfStream = new FileStream("Output.pdf", FileMode.Create);
   chartControl1.ExportToPdf(pdfStream);
   // ...

   pdfStream.Close();
}