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: Convert an HTML Document to DOCX Format

The following code example shows how to convert an HTML document to the DOCX format using the RichEditDocumentServer.

View Example

server.LoadDocument("Documents\\TextWithImages.htm");
server.SaveDocument("Document_DOCX.docx", DocumentFormat.OpenXml);
System.Diagnostics.Process.Start("Document_DOCX.docx");

Note

Implement the IUriProvider descendant and override the IUriProvider.CreateCssUri or IUriProvider.CreateImageUri method to manage decoding external contents in an HTML file. It executes your method instead of the default one when the RichEditDocumentServer needs to load data from a specific URI. Refer to the How to: Retain the Image URI in HTML Document topic for details.

See Also