Skip to main content
Row

IWorkbook.ExportToPdf(Stream, PdfExportOptions) Method

Exports the workbook to the specified stream in PDF format using the specified options.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v25.1.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

void ExportToPdf(
    Stream stream,
    PdfExportOptions options
)

Parameters

Name Type Description
stream Stream

A Stream object to which the created PDF file should be sent.

options PdfExportOptions

A PdfExportOptions object specifying export settings.

Remarks

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;

using (FileStream pdfFileStream = new FileStream("Documents\\Document_PDF.pdf", FileMode.Create)) {
    workbook.ExportToPdf(pdfFileStream, options);
}
See Also