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 \
  --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.

    • Related Articles

    • How do I convert a presentation from one format to another? Any sample codes?

      To convert a presentation from one format (say .pptx) to another (say .ppsx, .odp, .pdf), you need to make use of Zoho Show's Conversion API. HTML Sample Code: <form method="POST" action="https://show.zoho.com/show/officeapi/v1/presentation/convert" ...
    • How do I save documents locally using "save_url" method? Any sample codes available?

      A "save_url" is a publicly accessible Web hook or a Web URL to which Zoho will push the updated document content from its Office editors (Writer, Sheet, Show) to your storage server. In order to make use of "save_url" method and save document ...
    • Sample Codes - Java SDK

      All of Zoho CRM's APIs can be used through the Java SDK, to enable your custom application to perform data sync to the best degree. Here are the sample codes for all the API methods available in our SDK. Rest Client Operations These methods involve ...
    • Sample Codes - Python SDK

      All of Zoho CRM's APIs can be used through the Python SDK, to enable your custom application to perform data sync to the best degree. Here are the sample codes for all the API methods available in our SDK. Rest Client Operations These methods involve ...
    • Sample Codes - C# SDK

      All of Zoho CRM's APIs can be used through the C# SDK, to enable your custom application to perform data sync to the best degree. Here are the sample codes for all the API methods available in our SDK. Rest Client Operations These methods involve ...