Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to: Determine Formatting Capabilities Required to Export the Document

This example illustrates how to check if specific formatting features are contained in the document loaded in the RichEditDocumentServer, and determine whether an exporter can perform the document export correctly.

The Document.RequiredExportCapabilities property provides access to an object which has several properties, indicating whether a particular formatting feature is used.

The following code snippet illustrates how you can detect if the capabilities of your custom exporter match the formatting capabilities required to export the current document. First, declare the exporter capabilities in the DocumentExportCapabilities structure, and then compare it with the structure obtained via the Document.RequiredExportCapabilities property.

DevExpress.XtraRichEdit.DocumentExportCapabilities myExportFeatures = 
    new DevExpress.XtraRichEdit.DocumentExportCapabilities();
myExportFeatures.CharacterFormatting = true;
myExportFeatures.ParagraphFormatting = true;
myExportFeatures.InlinePictures= true;

if(myExportFeatures.Contains(richEditControl1.Document.RequiredExportCapabilities))
    MessageBox.Show("The document can be exported");