Back to Devexpress

RichEditControl.ExportToPdf(String, PdfExportOptions) Method

wpf-devexpress-dot-xpf-dot-richedit-dot-richeditcontrol-dot-exporttopdf-x28-system-dot-string-devexpress-dot-xtraprinting-dot-pdfexportoptions-x29.md

latest2.9 KB
Original Source

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.Xpf.RichEdit

Assembly : DevExpress.Xpf.RichEdit.v25.2.dll

NuGet Package : DevExpress.Wpf.RichEdit

Declaration

csharp
public void ExportToPdf(
    string fileName,
    PdfExportOptions pdfExportOptions
)
vb
Public Sub ExportToPdf(
    fileName As String,
    pdfExportOptions As PdfExportOptions
)

Parameters

NameTypeDescription
fileNameString

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

The following code snippet exports the RichEditControl’s document to the PDF file with specified options:

csharp
PdfExportOptions options = new PdfExportOptions();
options.DocumentOptions.Author = "John Doe";
options.DocumentOptions.Title = "Breakeven Analysis";
options.ImageQuality = PdfJpegImageQuality.Medium;
options.ExportBookmarks = false;

richeditControl1.ExportToPdf("Exported_String_Options_Document.pdf", options);
vb
Dim options As PdfExportOptions = New PdfExportOptions()
options.DocumentOptions.Author = "John Doe"
options.DocumentOptions.Title = "Breakeven Analysis"
options.ImageQuality = PdfJpegImageQuality.Medium
options.ExportBookmarks = False

richeditControl1.ExportToPdf("Exported_String_Options_Document.pdf", options)

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

See Also

RichEditControl Class

RichEditControl Members

DevExpress.Xpf.RichEdit Namespace