Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

// Get clientId and clientSecret from https://dashboard.aspose.cloud/
String clientId = "c235e685-1aab-4cda-a95b-54afd63eb87f";
String clientSecret = "b8da4ee37494f2ef8da3c727f3a0acb9";
// if baseUrl is null, WordsApi uses default https://api.aspose.cloud
// create an object of ApiClient by providing user specific ClientID and Client Secret
ApiClient apiClient = new ApiClient(clientId,clientSecret,null);
// create an object of WordsApi by providing ApiClient as argument
WordsApi wordsApi = new WordsApi(apiClient);
// input PDF document
String inputFile = "file-sample.docx";
String firstFileToAppend = "test_multi_pages.docx";
String resultantFile = "Resultant.docx";
// specify the first document to be appended
DocumentEntry docEntry = new DocumentEntry().href(firstFileToAppend).importFormatMode("KeepSourceFormatting");
// specify the list of documents to be appended
DocumentEntryList documentList = new DocumentEntryList().addDocumentEntriesItem(docEntry);
// Specify the conversion parameters
AppendDocumentRequest request = new AppendDocumentRequest(inputFile, documentList, null, null, null, null, resultantFile, null, null);
// save the resultant merged DOCX file
DocumentResponse result = wordsApi.appendDocument(request);
Merge DOCX files usinig Aspose.Words Cloud SDK for Java.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment