[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Collapse]Office File API
  Demo Application
  Redistribution and Deployment
 [Expand]Spreadsheet Document API
 [Collapse]Word Processing Document API
   Getting Started
  [Expand]WordProcessing Document
  [Expand]Merge and Split Documents
   Import and Export
   Text Formatting
  [Expand]Mail Merge
   Export to PDF
   Document Protection
   HTML Tag Support
 [Expand]PDF Document API
 [Expand]Excel Export Library
 [Expand]Snap Report API
 [Expand]Zip Compression and Archive API
 [Expand]Barcode Generation API
 [Expand]Unit Conversion API
 [Expand]API Reference
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Export to PDF

Call the RichEditDocumentServer.ExportToPdf method to export the document to the PDF format. Use the PdfExportOptions object's properties to define the required export options, as shown in the following code:

Sections below provide more detailed information about the PDF export specifics.

Expanded PDF Document Versions

The PDF export engine produces PDF documents of the following versions depending on specified export options:

Expanded PDF Cross-Compatibility

PDF generation does not require installing third-party components on an end-user's machine.

  • When including Far-Eastern and Arabic fonts into PDF, make sure that the included fonts contain all necessary characters.
  • Document hyperlinks will be active in PDF only if the Create links from URLs setting is enabled in Adobe® Reader installed on the target machine.

    To access this option in the program's Edit menu, click Preferences and in the invoked dialog, switch to General.

The document pages' background is filled with the color specified by the XtraReport.PageColor property. If you want to add a background image to the PDF file, set this property to Transparent.

The PDF options are provided by the PdfExportOptions class. These options can be accessed via a report's ExportOptions.Pdf property and are detailed in the following sections.

Expanded PDF/A Options

The following PDF/A specifications are supported.

  • PDF/A-1b (ISO 19005-1)
  • PDF/A-2b (ISO 19005-2:2011)
  • PDF/A-3b (ISO 19005-3:2012)

To make a document compatible with the PDF/A specification, use the following options.

If the PdfExportOptions.PdfACompatibility property is set to PdfACompatibility.None (the default value), the resulting document will conform to the ISO 32000-1:2005 standard without any restrictions.

For a code sample, refer to the following example online: How to export a report to ZUGFeRD.

For the current versions of the library, consider the following restrictions associated with PDF/A compatibility.

  • All PDF/A versions implicitly prohibit encryption.
  • All fonts that are used in PDF/A documents should be embedded.
  • The PDF/A-1b and PDF/A-2b standards do not support attachments.
  • The PDF/A-1b standard does not support transparency, and the alpha channel in images will be ignored.

To check the validity of PDF export options, use the PdfExportOptions.Validate method that returns a list of any detected inconsistencies.

Expanded Document Options

Expanded Security Options

Expanded File Size Optimization

Use the following options to vary the quality of PDF-embedded images and in this way, control the resultant file size.

To reduce the size of large documents (e.g., before sending them via e-mail), you can use the following option.

As for the embedded fonts and PDF page content, they are always compressed in the resulting PDF file.

Expanded Current Limitations

At present, the following limitations apply to PDF export:

  • Glyph Shaping does not work for non-embedded fonts.
  • Support for right-to-left languages with non-embedded fonts requires that your application runs under full trust.
  • Export of vector EMF and WMF images is not supported. The current export mechanism supports EMF+ only.

Expanded See Also

Is this topic helpful?​​​​​​​