Skip to main content
All docs
V24.1

Troubleshooting

  • 3 minutes to read

This topic describes how to identify issues that can occur when the Rich Text Editor opens and renders documents in different formats.

The Rich Text Editor allows you to import HTML files and save documents as HTML. When you open an HTML file, the control converts HTML content into its internal document model. Some HTML tags and CSS attributes have no counterparts in Open XML and RTF formats. You can find more information about supported and unsupported HTML tags in the following help topic: HTML Support Limitations. However, we must emphasize that the Rich Text Editor is not an HTML editor/browser. It can display your HTML document differently from your web browser even if all HTML tags were imported into the control’s document model.

If the Rich Text Editor cannot load your document or displays it incorrectly, follow the steps below to identify the cause of the issue:

  1. Try to update your application to the latest version of DevExpress components and check whether your issue has been fixed in this version.

    Download the Registered Version | Download the Trial Version

  2. Use our Document Content Validator app to check whether your DOCX or RTF document contains tags ignored by the Rich Text Editor when it displays the document.

    Follow this link to download the Document Content Validator: https://github.com/DevExpress-Examples/rich-text-editor-document-content-validator.

    Run the application and open your document. The Skipped Content table displays skipped tags that can affect the document content and appearance.

    Rich Text Editor - Document Content Validator

    Note

    We are continually updating our Document Content Validator. If it did not help you identify the issue with your document, submit a ticket to our Support Center. Attach your document to the ticket and describe the steps needed to reproduce your issue. We will examine your document for unsupported tags and update our Document Content Validator app.

  3. Handle the RichEditControl.UnhandledException and RichEditControl.InvalidFormatException events as shown below and check the generated logs.

    richEditControl1.UnhandledException += (sender, e) =>
    {
        AppendLogEntry(e.Exception);
    };
    
    richEditControl1.InvalidFormatException += (sender, e) =>
    {
        AppendLogEntry(e.Exception);
    };
    // ...
    
    private void AppendLogEntry(Exception exception)
    {
        System.Text.StringBuilder msg = new System.Text.StringBuilder();
        msg.AppendLine(exception.GetType().FullName);
        msg.AppendLine(exception.Message);
        System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace();
        msg.AppendLine(st.ToString());
        msg.AppendLine();
        String desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
        string logFilePath = String.Format("{0}\\{1}", desktopPath, "logfile.txt");
        System.IO.File.AppendAllText(logFilePath, msg.ToString());
    }
    

If none of these steps helped you identify the issue with your document, please contact our DevExpress Support Team.