[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
   [Expand]Product Information
   [Expand]Getting Started
   [Expand]Fundamental Concepts
    [Expand]Basic Terms
    [Expand]Print Preview
      Export to PDF
      Export to HTML
      Export to MHT
      Export to Text
      Export to CSV
      Export to XLS
      Export to XLSX
      Export to RTF
      Export to DOCX
      Export to Image
      Export to MailMessage
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[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
[Expand]Office File API
[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

This topic details the specifics of exporting a document to PDF (Portable Document Format).


See the following code examples illustrating how to export a report to PDF in code:

This topic consists of the following sections.

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.

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