# Export to PDF

The export feature allows you to save the data from the DataGrid component to few [different formats](https://www.telerik.com/winui/documentation/controls/raddatagrid/export/overview#supported-formats). This article shows how to save it to **PDF**.

## Exporting the Document

The feature works with the `Export` and `ExportAsync` methods of `RadDataGrid`. The methods allow you to provide a stream (usually pointing to a file), a document format and export options objects.

#### **Export DataGrid to PDF format**

```C#
string projectRootFolderPath = System.IO.Path.GetFullPath("../../../../../../", AppDomain.CurrentDomain.BaseDirectory);
using (var stream = File.Open(projectRootFolderPath + "\\" + "SampleDocument.pdf", FileMode.OpenOrCreate))
{
	this.dataGrid.Export(stream, ExportFormat.Pdf);
}
```

To include additional settings for the document, use the `DataGridExportOptions` class. Read more about the available settings in the [Modifying Exported Data](https://www.telerik.com/winui/documentation/controls/raddatagrid/export/modifying-exported-data#export-options) article.

#### **Using the DataGridExportOptions**

```C#
string projectRootFolderPath = System.IO.Path.GetFullPath("../../../../../../", AppDomain.CurrentDomain.BaseDirectory);
using (var stream = File.Open(projectRootFolderPath + "\\" + "SampleDocument.pdf", FileMode.OpenOrCreate))
{
	this.dataGrid.Export(stream, ExportFormat.Pdf, new DataGridExportOptions()
	{
		AutoFitColumnsWidth = true,
		ShowColumnFooters = true,
		ShowColumnHeaders = false,
		IgnoreCollapsedGroups = true
	});
}
```

> tip The **exporting process can be customized** at runtime using the `ElementExporting` and `ElementExported` events of `RadDataGrid`. Read more in the [Modifying Exported Data](https://www.telerik.com/winui/documentation/controls/raddatagrid/export/modifying-exported-data) article.

## See Also

* [Getting Started](https://www.telerik.com/winui/documentation/controls/raddatagrid/gettingstarted)
* [Modifying Exported Data](https://www.telerik.com/winui/documentation/controls/raddatagrid/export/modifying-exported-data)
* [Export to Xls and Xlsx](https://www.telerik.com/winui/documentation/controls/raddatagrid/export/xlsx)
* [Export to CSV](https://www.telerik.com/winui/documentation/controls/raddatagrid/export/csv)
