officefileapi-devexpress-dot-spreadsheet-dot-iworkbook-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 workbook to the specified file path in PDF format using the specified options.
Namespace : DevExpress.Spreadsheet
Assembly : DevExpress.Spreadsheet.v25.2.Core.dll
NuGet Package : DevExpress.Spreadsheet.Core
void ExportToPdf(
string fileName,
PdfExportOptions options
)
Sub ExportToPdf(
fileName As String,
options As PdfExportOptions
)
| Name | Type | Description |
|---|---|---|
| fileName | String |
A String which specifies the file name (including the full path) for the created PDF file.
| | options | PdfExportOptions |
A PdfExportOptions object specifying export settings.
|
The following code snippet exports the spreadsheet document as a PDF file with the specified settings:
IWorkbook workbook = spreadsheetControl1.Document;
PdfExportOptions options = new PdfExportOptions();
options.DocumentOptions.Author = "John Doe";
options.DocumentOptions.Title = "Breakeven Analysis";
options.ImageQuality = PdfJpegImageQuality.Medium;
options.ExportBookmarks = false;
workbook.ExportToPdf("Documents\\Document_PDF.pdf", options);
Dim workbook As IWorkbook = spreadsheetControl1.Document
Dim options As New PdfExportOptions()
options.DocumentOptions.Author = "John Doe"
options.DocumentOptions.Title = "Breakeven Analysis"
options.ImageQuality = PdfJpegImageQuality.Medium
options.ExportBookmarks = False
workbook.ExportToPdf("Documents\Document_PDF.pdf", options)
See Also