Convert a Word DOC to HTML with NET REST API

This tutorial describes the process to convert a Word DOC to HTML with NET REST API. We will use Aspose.Words for .NET Cloud SDK for exporting a DOC to HTML with C# Low Code API. Follow the steps given in this article and try the feature using the running sample C# REST API code.

Prerequisite

Steps to Convert Word to HTML with NET REST API

  1. Set Client ID and Client Secret for the API to convert DOC to HTML
  2. Instantiate an instance of the WordsAPI class with your credentials
  3. Set the input and output files
  4. Read input DOC file into a FileStream object
  5. Create the ConvertDocumentRequest object using the FileStream and output file format
  6. Call the ConvertDocument method to Convert DOC to HTML using the ConvertDocumentRequest object
  7. Save the output HTML file on the local disk

The aforementioned steps explain the conversion of a file format from Word to HTML with C# Low Code API. The process will commence by setting the client secret/id in the Configuration object and creating a WordsApi class object using the given configuration. In the next step, the source Word file is read into a FileStream object that is used in the ConvertDocumentRequest instance for converting the input DOC to HTML.

Code for Developing Word DOC to HTML Converter with C# Low Code API

This sample code demonstrates the process to convert DOC to HTML with C# REST API. The ConvertDocumentRequest class object is initiated with the input file byte stream and output file format along with the options to set the font location, the password for the encrypted Word files, and encoding details while loading the input file. Finally, the ConvertDocument() method is called in the WordsApi class to transform the DOC file to HTML.

You may also check out another similar feature on the following page: Convert Word DOC to Markdown with NET REST API.

 English