Convert DOC to JPEG Using a REST API

Do you have a DOC file and would like to take snapshots of all the pages?, maybe use them as thumbnails? Suppose you have a Word document with 100’s of pages, it would be a tedious task to manually convert every page into an image. That’s why you need our DOC to JPEG converter API, as it will automatically convert every page of the DOC file as JPEG image without the need for any additional software.

Doc to jpeg

Doc Conversion API offers an easy to use, fast, secure, and reliable REST API that you can connect to, and convert any Word DOC to a JPEG image while maintaining formatting and quality. Our API is carefully designed with a focus on quality and reliability. It is simple to execute, however, it is also highly flexible and can be configured to carry out heavy and complex conversions with maximum accuracy.

Convert DOC to JPEG using the REST API (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 DOC to JPEG by making a POST request, using the below URL Along with your APP credentials (Application ID and Secret Key):

https://api.docconversionapi.com/convert?outputFormat=jpeg

To make the following curl request:

curl --request POST \
  --url 'https://api.docconversionapi.com/convert?outputFormat=jpeg' \
  --header 'X-ApplicationID: <Your_Application_ID>' \
  --header 'X-SecretKey: <Your_Application_SecretKey>' \
  --header 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
  --form inputFile=undefined \
  --form 'optionsJSON={"pages" : "all"}'

X-ApplicationID is your Application ID

X-SecretKey      is your Secret Key

OutPutFormat is JPEG

InputFile         is the file you would like to convert

optionsJSON is a JSON String containing any additional options relevant to the conversion type.

Convert DOC to JPEG using the REST API (PHP)

Doc Conversion API is compatible with all main programming languages and frameworks, you can find a list of code examples here.

For this PHP example, we’re using a direct URL to our word document (the document we’re converting) for simplicity, you can also upload your local documents to the service.

We’re going to be using this example:

http://www.snee.com/xml/xslt/sample.doc

DOC to JPEG

We’re going to create a simple PHP page that reads the Doc file from a URL, and converts this file into a JPEG image that is displayed as a web page:

doc to jpeg

Download this page / View this page

 

This code will execute the conversion, and display the Word DOC content as a JPEG page.

doc to jpeg

 

 

If you have any questions or need any further help, please contact us at [email protected]