wpf-devexpress-dot-xpf-dot-spreadsheet-dot-spreadsheetcontrol-dot-exporttopdf-x28-system-dot-string-devexpress-dot-xtraprinting-dot-pdfexportoptions-x29.md
Using file paths sourced from untrusted input may expose unauthorized files or allow unintended file access. Always validate and normalize all external paths to prevent path manipulation.
Exports the content of the SpreadsheetControl to the specified file in PDF format using the specified options.
Namespace : DevExpress.Xpf.Spreadsheet
Assembly : DevExpress.Xpf.Spreadsheet.v25.2.dll
NuGet Package : DevExpress.Wpf.Spreadsheet
public void ExportToPdf(
string fileName,
PdfExportOptions options
)
Public Sub ExportToPdf(
fileName As String,
options As PdfExportOptions
)
| 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.
| | options | PdfExportOptions |
A PdfExportOptions object which specifies the PDF export options.
|
The following code snippet exports the spreadsheet’s document to the PDF file with specified options:
PdfExportOptions options = new PdfExportOptions();
options.DocumentOptions.Author = "John Doe";
options.DocumentOptions.Title = "Breakeven Analysis";
options.ImageQuality = PdfJpegImageQuality.Medium;
options.ExportBookmarks = false;
spreadsheetControl1.ExportToPdf("Exported_String_Options_Document.pdf", options);
Dim options As PdfExportOptions = New PdfExportOptions()
options.DocumentOptions.Author = "John Doe"
options.DocumentOptions.Title = "Breakeven Analysis"
options.ImageQuality = PdfJpegImageQuality.Medium
options.ExportBookmarks = False
spreadsheetControl1.ExportToPdf("Exported_String_Options_Document.pdf", options)
Refer to the Export to PDF document to learn about PDF export features and limitations.
See Also