Skip to main content

PdfStreamingExporter Class

Provides the functionality for exporting reports to PDF in streaming modes.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v24.1.dll

NuGet Package: DevExpress.Reporting.Core

Declaration

public class PdfStreamingExporter

Remarks

The PdfStreamingExporter class allows you to export reports to the PDF format in two export modes: streaming and multi-threaded streaming export.

Exporting large documents in each of these modes consumes much less memory in comparison with the in-memory mode (using the XtraReport.ExportToPdf methods). This helps you to overcome issues with an OutOfMemory exception and export reports of many thousands of pages.

The multi-threaded streaming export can create a PDF file in parallel with report document generation in different threads, due to which the export operation can be up to two times faster. When you encounter limitations on the number of threads (such as in a web application scenario), you can use single-thread streaming export.

Note

This class can be unsuitable in some rare cases, when your report contains specific customization with document bricks (for instance, in report scripts). Also, when you use PdfStreamingExporter, the PrintOnPageEventArgs.PageCount property in the XRControl.PrintOnPage event handler does not return the number of pages. To handle such cases, use the in-memory mode and call XtraReport.ExportToPdf methods to export reports.

To perform the export operation, create a new instance of the PdfStreamingExporter and call the PdfStreamingExporter.Export method. The class constructor accepts two arguments: the report you want to export and a value indicating whether to use multi-threaded or single-threaded streaming export.

using DevExpress.XtraReports.UI;

LargeReport report = new LargeReport();
new PdfStreamingExporter(report, true).Export("LargeReport.pdf");

Inheritance

Object
PdfStreamingExporter
See Also