This simple guide assists you to convert DOCX to DOC with NET REST API. We will use Aspose.Words for .NET Cloud SDK to perform this task. Detailed steps and a sample code are shared to transfer DOCX to DOC with C# REST API in various platforms supporting this SDK.
Prerequisite
- Create an account and get API credentials
- Download Aspose.Words Cloud SDK for Dotnet
- Setup C# project with the above SDK
Steps to Transform DOCX to DOC with C# Low Code API
- Set Client ID and Client Secret for the API
- Create an object of the Configuration class and set client credentials
- Create an object of the WordsAPI class with the configuration object
- Specify input and output files
- Read the input DOCX file and save it to the byte array
- Instantiate the ConvertDocumentRequest() method using the above byte array
- Call the ConvertDocument method to Convert DOCX to DOC using REST API
- Save the output DOC file on the local disk
These steps explain the process to change the DOCX file to DOC with C# Low Code API. In the initial steps, the client ID and secret are used to initialize the Configuration class object, the WordsApi object is declared using the specified configuration, the input file is read into a byte array, and the ConvertDocumentRequest object is created for actual transformation. Finally, the ConvertDocument() method is called from the WordsApi class to convert the DOCX to DOC format.
Code to Format DOCX to DOC with C# REST API
Follow this code to change DOCX to DOC file with NET REST API. The WordsApi has multiple overloads, therefore you may use it without declaring the Configuration object and setting the client ID and credentials directly. You may set the various properties in the ConvertDocumentRequest() constructor for instance, the source file encryption password, original document storage if already uploaded, and the file name of the output document.
You may also check out another similar feature on the following page: How to convert DOCX to JPG with NET REST API.