Skip to main content

RichEditControl.ExportToPdf(String) Method

Exports the document content to the specified file path in PDF format.

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.XtraRichEdit.v24.2.dll

Declaration

public void ExportToPdf(
    string fileName
)

Parameters

Name Type Description
fileName String

A String which specifies the file name (including the full path) for the created PDF file.

Remarks

PDF Export features and limitations are detailed in the Export to PDF document.

To print the document, use the RichEditControl.Print method.

Example

View Example: The Rich Text Editor's Common API

The following code sample specifies PDF export options and saves a document in PDF format:

using DevExpress.XtraRichEdit;
using DevExpress.XtraPrinting;
//...

// Load a DOCX document.
richEditControl.LoadDocument("Documents\\Grimm.docx");

// Specify PDF export options.
PdfExportOptions options = new PdfExportOptions();
options.DocumentOptions.Author = "Mark Jones";
options.Compressed = false;
options.ImageQuality = PdfJpegImageQuality.High;

// Export the document to PDF.
richEditControl.ExportToPdf("Output_Document.pdf", options);
See Also