ChartControlBase.ExportToPdf(String, PrintSizeMode) Method
Exports a chart to the specified file using the specified size mode in the PDF format.
Namespace: DevExpress.Xpf.Charts
Assembly: DevExpress.Xpf.Charts.v19.1.dll
Declaration
Parameters
Name | Type | Description |
---|---|---|
filePath | String | The value defining the full path (including the file name and extension) where the PDF file will be created. |
sizeMode | PrintSizeMode | The value specifying which size mode the chart must use when the chart control is exported. |
Remarks
To print the document immediately without invoking any dialogs, use the ChartControlBase.PrintDirect method.
To show the standard Print dialog, use the ChartControlBase.Print method. The dialog allows end-users to print the chart, select the printer (if required), specify the range of pages to print, the number of copies, etc.
To display the DevExpress Document Preview, use one of the following methods.
Method | Description |
---|---|
ChartControlBase.ShowPrintPreview | Creates the print document and displays the Print Preview of the document. |
ChartControlBase.ShowPrintPreviewDialog | Creates the print document and displays the Print Preview of the document as a modal window. |
ChartControlBase.ShowRibbonPrintPreview | Creates the print document and displays the Print Preview with the Ribbon toolbar of the document. |
ChartControlBase.ShowRibbonPrintPreviewDialog | Creates the print document and displays the Print Preview with the Ribbon toolbar of the document as a modal window. |
To export the chart, use the appropriate ExportTo~ method (e.g., ChartControlBase.ExportToHtml, ChartControlBase.ExportToPdf, etc.)
Important
The chart can be previewed, printed and exported only if the DXPrinting Library is available. Make sure you add a reference to the DevExpress.Xpf.Printing.v19.1 assembly.
Also note that chart export to PDF is available if the DevExpress.Pdf.Core library is available.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ExportToPdf(String, PrintSizeMode) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.