With Doc Conversion API, you can convert easily between document formats, converting between Word DOC to HTML is a very important conversion for a number of reasons.
It will allow you to turn an existing Word document into an HTML page, this will eliminate the risk of losing or editing any document content. With this conversion, you no longer need to worry about downloading documents and having them in a single location, you can access them from any device (mobile phones, tablets, computers), on any platform, with no extra software.
While there are a number of ways to convert a Word DOC to an HTML page, there has not been a single perfect method to do this both easily and efficiently, and without compromising on formatting or fidelity. But that’s where Doc Conversion API comes for the rescue, as it provides a very simple, reliable REST API that you can call into and execute with simple code, and quickly convert your Word Documents into fully formatted HTML pages.
Using the REST API to convert Doc to HTML (CURL)
Doc Conversion API is compatible with all programming languages and frameworks, you can find a list of code examples here.
You can simply convert from DOCto HTML by making a POST request, using the below URL Along with your APP credentials (Application ID and Secret Key):
To make the following curl request:
curl --request POST \
--url 'https://api.docconversionapi.com/convert?outputFormat=html' \
--header 'X-ApplicationID: <Your_Application_ID>' \
--header 'X-SecretKey: <Your_Application_SecretKey>' \
--header 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
--form inputFile=undefined \
X-ApplicationID is your DCA Application ID
X-SecretKey is your DCA Secret key
OutPutFormat is HTML
InputFile is the file you would to like to convert
optionsJSON is a JSON String containing any additional options relevant to the conversion type.
Using the REST API to convert Doc to HTML (PHP)
Doc Conversion API is compatible with most programming languages and frameworks, you can find a list of code examples here.
For this PHP example, we’re using a direct URL for our word document (the document we’re converting) for simplicity, you can also upload documents to the service.
We’re going to be using this example:
We’re going to create a simple PHP page that reads the Doc file from a URL, and converts this file into an HTML page:
This code will execute the conversion, and display the Word Doc content as an HTML page.
If you have any questions or need any further help, please contact us at [email protected]