Conversion

Use Wordize for .NET conversion feature to convert a document from one format to another using C#. Use various Wordize modules to convet DOCX to HTML, DOCX to PDF, Web formats to Word formats and so on.

Wordize’s document conversion feature allows developers to easily convert documents from one format to another, ensuring high fidelity and preserving formatting, styles, and content.

With a variety of modules tailored to specific needs, Wordize offers powerful and flexible APIs for working with MS Word documents, web formats, eBooks, PDFs, and OpenOffice files.

The following list of modules and formats is currently available:

ModuleSupported formats
Wordize.Core for .NETLoad/Save MS Word document formats (DOC, DOCX, RTF, FlatOpc, XML, TXT, XLSX)
Wordize.Web for .NETLoad/Save Web formats (HTML, MHTML, MD, CHM)
Wordize.eBook for .NETLoad/Save eBook formats (EPUB, AWZ3, MOBI)
Wordize.OpenOffice for .NETLoad/Save open office documents (ODT, OTT)
Wordize.Load PDF for .NETLoad PDF documents (PDF).
no rendering here
Wordize.Rendering for .NETSave documents to fixed page formats (PDF, XPS, SVG, PS, Image, PostScript, etc.)

How to work with conversion modules

There is a basic Wordize.Core for .NET module – it allows users to load and save documents in Microsoft Word format. Without purchasing this basic module, none of the other modules work.If you want to convert to a wider range of formats, you need additional modules:

  • If you want to convert from DOC to DOCX, you only need the basic module Wordize.Core for .NET
  • If you need to convert DOCX to HTML, then in addition to Wordize.Core for .NET, you will need the module Wordize.Web for .NET
  • If you need to convert DOCX to HTML and EPUB, you need the modules Wordize.Core for .NET, Wordize.Web for .NET, Wordize.OpenOffice for .NET and so on

What is document conversion?

Conversion is the process of loading a document and then saving it in the target format. You can load a document from a stream or file and also save it to a stream or file.

Wordise simplifies the process of converting your documents. You don’t need to load and save the document separately. You simply use the Convert method with various overloads to perform the conversion in one action:

  • Convert(string, string)
  • Convert(string, string, SaveFormat)
  • Convert(Stream, Stream, SaveFormat)

Convert DOCX to HTML

If you want to convert DOCX to HTML, you will need the Wordize.Core for .NET and Wordize.Web for .NET modules and the corresponding licenses.

The following code example shows how to convert DOCX to HTML using the Convert(string, string) method:

string doc = MyDir + "Document.docx";
Converter.Convert(doc, ArtifactsDir + "ConvertedDocument.html");

The following code example shows how to convert DOCX to HTML using the Convert(string, string, SaveFormat) method:

string doc = MyDir + "Document.docx";
Converter.Convert(doc, ArtifactsDir + "ConvertedDocument.html", SaveFormat.Html);

The following code example shows how to convert DOCX to HTML using the Convert(Stream, Stream, SaveFormat) method:

using (FileStream streamIn = new FileStream(MyDir + "Document.docx", FileMode.Open, FileAccess.Read))
{
	using (FileStream streamOut = new FileStream(ArtifactsDir + "ConvertedDocument.html", FileMode.Create, FileAccess.ReadWrite))
		Converter.Convert(streamIn, streamOut, SaveFormat.Html);
}