Skip to main content

RichEditControl.ExportToPdf(String, PdfExportOptions) Method

SECURITY-RELATED CONSIDERATIONS

Using file paths sourced from untrusted input may expose unauthorized files or allow unintended file access. Always validate and normalize all external paths to prevent path manipulation.

Exports the content of the RichEditControl to the specified file path in PDF format, applying PDF-specific options.

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.XtraRichEdit.v26.1.dll

Declaration

public void ExportToPdf(
    string fileName,
    PdfExportOptions pdfExportOptions
)

Parameters

Name Type Description
fileName String

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

pdfExportOptions PdfExportOptions

A PdfExportOptions object which specifies the PDF export options.

Remarks

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

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);

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ExportToPdf(String, PdfExportOptions) 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.

See Also