Skip to main content

RichEditDocumentServer.ExportToPdf(String, PdfExportOptions) Method

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

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.RichEdit.v23.2.Core.dll

NuGet Packages: DevExpress.RichEdit.Core, DevExpress.Win.Navigation

Declaration

public virtual 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 following document: Export to PDF

Note

If an application is hosted on Microsoft Azure, set the AzureCompatibility.Enable property to true on application startup.

using (var wordProcessor = new RichEditDocumentServer()) {
  wordProcessor.LoadDocument("Documents//MovieRentals.docx", DocumentFormat.OpenXml);

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

  // Export the document to the file:
  wordProcessor.ExportToPdf("Document_PDF.pdf", options);
}

System.Diagnostics.Process.Start("Document_PDF.pdf");
See Also