Skip to content

Instantly share code, notes, and snippets.

@aspose-cloud
Last active April 22, 2021 00:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-cloud/14ab24b96cb1b0d66e54c343abcb88cc to your computer and use it in GitHub Desktop.
Save aspose-cloud/14ab24b96cb1b0d66e54c343abcb88cc to your computer and use it in GitHub Desktop.
This Gist repository contains code snippet related to Aspose.Words Cloud SDK for Java

The Gist contains code snippets related to Aspose.Words Cloud SDK for Java. For more information on usage of these code snippets, please visit the following links

Convert PDF to DOCX using Aspose.Words Cloud SDK for Java.
// Get clientId and clientSecret from https://dashboard.aspose.cloud/
String clientId = "c235e685-1aab-4cda-a95b-54afd63eb87f";
String clientSecret = "b8da4ee37494f2ef8da3c727f3a0acb9";
// create an object of ApiClient by providing user specific ClientID and Client Secret
// If baseUrl is null, WordsApi uses default https://api.aspose.cloud
com.aspose.words.cloud.ApiClient apiClient = new com.aspose.words.cloud.ApiClient(clientId,clientSecret,null);
// create an object of WordsApi by providing ApiClient as argument
com.aspose.words.cloud.api.WordsApi wordsApi = new com.aspose.words.cloud.api.WordsApi(apiClient);
// input PDF document
String inputFile = "demo.pdf";
// specify output format
String resultantFormat = "docx";
// specify the resultant file name
String resultantFile = "demo_Converted.docx";
// create an object to specify output file format
com.aspose.words.cloud.model.SaveOptionsData saveOptions = new SaveOptionsData();
// set output format as DOCX
saveOptions.saveFormat(resultantFormat);
saveOptions.fileName(resultantFile);
// Specify the conversion parameters
com.aspose.words.cloud.model.requests.SaveAsRequest request = new SaveAsRequest(inputFile, saveOptions, null, null, null, null, null);
// save the resultant DOCX file
SaveResponse result = wordsApi.saveAs(request);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment