Supported Document Formats and Printing
- 2 minutes to read
This topic describes the Rich Edit control’s supported document formats and how to print documents.
Contents
Supported Document Formats
The DevExpress ASP.NET Rich Edit control allows you to open and save documents in different formats.
End-users can specify a document’s format using the Rich Edit’s UI. See the ASPxRichEdit: Load and Save online demo.
- You can specify a document’s format using server or client methods with the DocumentFormat parameter. See the Import and Export topic for details on how to open and save documents programmatically.
The ASPxRichEdit control supports the following file extensions:
- Office Open XML format (aka MS Office 2007 or DOCX)
- Microsoft Word 97-2003 format (DOC)
- Rich Text Format (RTF)
- Plain Text (TXT)
- HyperText markup language (HTML)
- Web page archive format (MHTML)
- OpenDocument format (ODT, implemented by the OpenOffice.org office suite)
- WordML format (XML)
- Electronic Publication (EPUB)
Portable document format (PDF - programmatic export only)
RichEdit exports documents to PDF using the DevExpress PDF exporting server engine. The server engine’s document layout differs from the RichEdit’s client document layout, so, the layout in the resulting PDF file may not be the same as in the RichEdit.
You also can open DOT (DOTX) files if you open the file as regular DOC (DOCX) documents as shown in the code snippet below. However, we recommend that you convert template documents to the DOC or DOCX format.
protected void loadDot_Click(object sender, EventArgs e) {
ASPxRichEdit1.Open(Server.MapPath("~/App_Data/WorkDirectory/sample.dot"), DevExpress.XtraRichEdit.DocumentFormat.Doc);
}
Printing
The ASPxRichEdit allows you to print documents by invoking a browser-specific Print dialog.
End-users can invoke the dialog via the control’s UI or by pressing CTRL + P
- You can invoke the dialog programmatically using the client-side RichEditCommands.filePrint command.
Document printing in RichEdit is performed in two stages:
- Exporting the active document to PDF;
- Printing the PDF document through a client browser’s dialog.
You can disable the printing functionality using Operation Restrictions by setting the ASPxRichEditBehaviorSettings.Printing property to Disabled or Hidden.