ASP.NET HTML Editor - Import, Export, and Pasting

ASP.NET Team Blog
14 September 2016

Did you know that the DevExpress ASP.NET HTML Editor control has three major features to help you work with Microsoft Word and different document formats? Let's explore these three major features:

  • Import
  • Export
  • Paste (from Word and paste options)

Watch this video to learn how importing, exporting, and pasting with the DevExpress ASP.NET HTML Editor:

Below are several of the links to demos and documentation mentioned in the video.

Import

The DevExpress ASP.NET HTML Editor can import several different formats:

  • Rich Text (.rtf)
  • Office Open XML (.docx)
  • MIME HTML (.mht)
  • Open Document (.odt)
  • Plain Text (.txt)

When importing, the DevExpress ASP.NET HTML Editor will read the source format and convert it to HTML. The control's Import method provides you several overloads to make importing easier.

See it in action by testing the Import demo.

Export

The DevExpress ASP.NET HTML Editor can export several different formats:

  • Rich Text (.rtf)
  • Office Open XML (.docx)
  • MIME HTML (.mht)
  • Open Document (.odt)
  • Plain Text (.txt)
  • Portable Document (.pdf). Available for export only.

Your end-users can export directly from the HTML Editor control's toolbar:

Toolbar Export

Watch the video to learn how to easily add an export button to your DevExpress ASP.NET HTML Editor toolbar.

You can also programmatically export using the export method from the ASP.NET server-side or client-side.

Test the HTML Editor's toolbar export capabilities now.

Paste

Your end-users have two great ways to paste:

1. Paste from Word Dialog

The Paste from Word dialog allows end-users to paste the text from a Word document using the clipboard. Pasting the text using this dialog preserves text formatting and font settings. End-users can opt not to preserve the text's font family.

Paste from Word

2. Paste formatting

The DevExpress ASP.NET HTML Editor control provides the capability to automatically format pasted HTML content based on the PasteMode property, which can be set in one of the following values:

  • SourceFormatting - The formatting of the pasted content is retained. A style definition that is associated with the copied text is copied to the destination document.
  • MergeFormatting - The formatting of the pasted content is mostly discarded. However, emphasis formatting, such as bold and italic text, is retained. The content takes on the style characteristics of the paragraph where it is pasted. The content also takes on any direct formatting or style properties of the element that immediately precedes the cursor when the content is pasted.
  • PlainText - The formatting of the pasted content and non-text elements, such as pictures or tables, is discarded. The text takes on the style characteristics of the paragraph where it is pasted and takes on any direct formatting or character style properties of text that immediately precedes the cursor when the text is pasted. Graphical elements are discarded, and tables are converted to a series of paragraphs.

End-users can change the formatting of the pasted HTML content using paste options bar buttons, which appear in the top right corner of the design area after the content is pasted. By default, this functionality is disabled.

See it in action by testing the Paste Formatting demo now.


Your Next Great .NET App Starts Here

Year after year, .NET developers such as yourself consistently vote DevExpress products #1.

Experience the DevExpress difference for yourself and download a free 30-day trial of all our products today: DevExpress.com/trial.

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.
No Comments

Please login or register to post comments.