Skip to main content

SpreadsheetControl.ExportToPdf(Stream, PdfExportOptions) Method

Exports the content of the SpreadsheetControl to the specified stream in PDF format using the specified options.

Namespace: DevExpress.Xpf.Spreadsheet

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

NuGet Package: DevExpress.Wpf.Spreadsheet

Declaration

public void ExportToPdf(
    Stream stream,
    PdfExportOptions options
)

Parameters

Name Type Description
stream Stream

A Stream object, to which the created document is exported.

options PdfExportOptions

A PdfExportOptions object which specifies the PDF export options.

Remarks

The following code snippet exports the spreadsheet’s document to the PDF file with specified settings:

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("Exported_Stream_Document.pdf", FileMode.Create))
{
    spreadsheetControl1.ExportToPdf(pdfFileStream,  options);
}

Refer to the Export to PDF document to learn about PDF export features and limitations.

See Also