How do I convert a document from one format to another? Any sample codes?
How do I convert a document from one format to another? Any sample codes?
To convert a document from one format (say
.docx
) to another (say
.html, .pdf,
etc.), you need to make use of Zoho Writer's
Conversion API
.
HTML Sample Code:
<form method="POST" action="
https://writer.zoho.com/writer/officeapi/v1/document/
convert
" enctype="multipart/form-data" target="_self" accept-charset="UTF-8">
Upload Document: <input type="file" name="document" size="38"> <br>
<input type="hidden" name="apikey" value="423s*****">
<input type="hidden" name="format" value="docx">
<input type="submit" name="submit" value="submit">
</form>
Curl Sample Code:
curl --request POST \
--url '
https://writer.zoho.com/writer/officeapi/v1/document/convert?apikey=423s*****
' \
--header 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
--form document=@/Users/username/Documents/Sample.docx \
--form format=docx
You can also build and test Conversion Document API requests right from your browser with Office Integrator
Postman Collection
.