SpreadsheetControl.ExportToPdf(String) Method
Exports the content of the SpreadsheetControl to the specified file in PDF format.
Namespace: DevExpress.XtraSpreadsheet
Assembly: DevExpress.XtraSpreadsheet.v24.2.dll
NuGet Package: DevExpress.Win.Spreadsheet
Declaration
Parameters
Name | Type | Description |
---|---|---|
fileName | String | A String which specifies the name (including the full path) of the PDF file to which the data is exported. |
Remarks
Refer to the Export to PDF document to learn about PDF export features and limitations.
Example
The following code snippet saves a document in PDF format with the specified settings:
using DevExpress.Spreadsheet;
using System.IO;
//...
// Access a workbook.
IWorkbook workbook = spreadsheetControl.Document;
// Load a document.
workbook.LoadDocument(@"Documents\Document.xlsx", DocumentFormat.Xlsx);
// Save the workbook as a PDF file.
workbook.ExportToPdf("Document_PDF.pdf");
See Also