Free Support Forum -

How to convert DOCX to PDF in JAVA with Aspose.Words REST API

I am using Aspose.Words Cloud API for doc(x) conversion to PDF without using cloud storage.
The code snippet I am using is as -

import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import com.aspose.words.api.WordsApi;
import com.aspose.words.model.ResponseMessage;

public class ConvertDocumentToFormatExample {

public static void main(String... argc) {

		WordsApi wordsApi = new WordsApi("MY_API_KEY",
				"MY_SID", false);
		String format = "pdf";
		String outPath = "";
		ResponseMessage apiResponse = wordsApi.PutConvertDocument(format, outPath, new File("path_to_doc_file"));
		if (apiResponse != null && apiResponse.getInputStream() != null) {
			InputStream responseStream = apiResponse.getInputStream();
			final Path destination = Paths.get("output.pdf");
			Files.copy(responseStream, destination, StandardCopyOption.REPLACE_EXISTING);
			System.out.println("conversion completed");

	} catch (Exception e) {


I am getting error as -
com.aspose.words.client.ApiException: {“Message”:“MIME multipart content is not supported by the operation.”}
at com.aspose.words.client.ApiInvoker.invokeAPI(
at com.aspose.words.api.WordsApi.PutConvertDocument(
at com.alphasense.docconverter.ConvertDocumentToFormatExample.main(

Please let me know what is incorrect in my request


Thanks for your inquiry. We have tested the scenario and noticed the reported issue with the Aspose.Words for Cloud for Java SDK. We are coordinating with our Cloud team and we will update you our findings soon.

We are sorry for the inconvenience.

Thanks Tilal.

Please update me as soon as you get any updates from SDK team on priority.


Thanks for your feedback. Sure, we have logged a ticket SDKDEV-533 with high priority for the issue and will notify you as soon as it is resolved


Thanks for your patience. Please note above reported issue SDKDEV-533 has been fixed in Aspose.Words for Cloud for Java SDK 10.8.0. It is pushed to Maven/GitHub as well.