Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Aspose-Words-Cloud-SDK-Java
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.TrackChangesInWordDocument;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.RevisionsModificationResponse;
import com.aspose.words.cloud.model.requests.AcceptAllRevisionsRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class AcceptAllRevisions {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_doc.docx";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
AcceptAllRevisionsRequest request = new AcceptAllRevisionsRequest(fileName, null, Constants.MYStorage, null, null, null);
RevisionsModificationResponse result = wordsApi.acceptAllRevisions(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.AppendDocument;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.DocumentEntry;
import com.aspose.words.cloud.model.DocumentEntryList;
import com.aspose.words.cloud.model.DocumentResponse;
import com.aspose.words.cloud.model.requests.AppendDocumentRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class AppendaDocument {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_doc.docx";
String documentToAppend = "test_multi_pages.docx";
String folder = ""; // File exists at the root of the storage
String destName = "Out_Merged.docx"; // // Changes will be made in the source document
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
// Upload the document to append to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + documentToAppend), "", Constants.MYStorage));
DocumentEntry docEntry = new DocumentEntry().href(documentToAppend).importFormatMode("KeepSourceFormatting");
DocumentEntryList documentList = new DocumentEntryList().addDocumentEntriesItem(docEntry);
AppendDocumentRequest request = new AppendDocumentRequest(fileName, documentList, folder, Constants.MYStorage,
null, null, destName, null, null);
DocumentResponse result = wordsApi.appendDocument(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.DocumentAndTextClassification;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.ClassificationResponse;
import com.aspose.words.cloud.model.requests.ClassifyDocumentRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class ClassifyTaxonomyDocument {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
ClassifyDocumentRequest request = new ClassifyDocumentRequest(fileName, null, Constants.MYStorage, null, null, null, null);
ClassificationResponse result = wordsApi.classifyDocument(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.CompareDocuments;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.CompareData;
import com.aspose.words.cloud.model.DocumentResponse;
import com.aspose.words.cloud.model.requests.CompareDocumentRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import org.threeten.bp.OffsetDateTime;
import java.io.File;
import Examples.Constants;
public class CompareDocument {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName1 = "compareTestDoc1.doc";
String fileName2 = "compareTestDoc2.doc";
String dest_name = "Out_ComparedTestDocs.doc";
CompareData compareData = new CompareData()
.author("author")
.comparingWithDocument(fileName2)
.dateTime(OffsetDateTime.now());
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName1), "", Constants.MYStorage));
// Upload the document to append to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName2), "", Constants.MYStorage));
CompareDocumentRequest request = new CompareDocumentRequest(fileName1, compareData,
null, Constants.MYStorage, null, null, dest_name);
DocumentResponse result = wordsApi.compareDocument(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.ConvertDocument;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.SaveOptionsData;
import com.aspose.words.cloud.model.SaveResponse;
import com.aspose.words.cloud.model.requests.SaveAsRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class ConvertPDFDocumentToWord {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.pdf";
String format = "docx";
String destName = "Out_test_multi_pages.docx";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
SaveAsRequest request = new SaveAsRequest(fileName, new SaveOptionsData().saveFormat(format).fileName(destName), null, Constants.MYStorage, null, null, null);
SaveResponse result = wordsApi.saveAs(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.ConvertDocument;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.ConvertDocumentRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class ConvertWordDocumentToAnotherFormat {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
String format = "pdf";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
ConvertDocumentRequest request = new ConvertDocumentRequest(new File("src/main/resources/" + fileName), format,
Constants.MYStorage, null, null, null);
File result = wordsApi.convertDocument(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.ConvertDocument;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.SaveOptionsData;
import com.aspose.words.cloud.model.SaveResponse;
import com.aspose.words.cloud.model.requests.ConvertDocumentRequest;
import com.aspose.words.cloud.model.requests.SaveAsRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class ConvertWordDocumentToAnotherFormatWithDetailedSettings {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
String format = "html";
String destName = "Out_test_multi_pages.html";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
SaveAsRequest request = new SaveAsRequest(fileName,new SaveOptionsData().saveFormat(format).fileName(destName),null,Constants.MYStorage,null,null,null);
SaveResponse result = wordsApi.saveAs(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.ConvertDocument;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.SaveResponse;
import com.aspose.words.cloud.model.TiffSaveOptionsData;
import com.aspose.words.cloud.model.requests.SaveAsTiffRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class ConvertWordDocumentToTiffWithDetailedSettings {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
String format = "tiff";
String destName = "Out_test_multi_pages.tiff";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
TiffSaveOptionsData saveOptionsData = new TiffSaveOptionsData();
saveOptionsData.setSaveFormat(format);
saveOptionsData.setFileName(destName);
SaveAsTiffRequest request = new SaveAsTiffRequest(fileName, saveOptionsData, null, Constants.MYStorage, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);
SaveResponse result = wordsApi.saveAsTiff(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithFiles;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.CopyFileRequest;
import Examples.Constants;
public class CopyFile {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
CopyFileRequest request = new CopyFileRequest("NewFolder\\test_multi_pages.docx", "NewFolder\\test_multi_pages1.docx", Constants.MYStorage, Constants.MYStorage, null);
wordsApi.copyFile(request);
} catch (
Exception e) {
System.err.println("Exception while calling Api:");
e.printStackTrace();
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithFolders;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.CopyFolderRequest;
import Examples.Constants;
public class CopyFolder {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
CopyFolderRequest request = new CopyFolderRequest("NewFolder", "NewFolder1", Constants.MYStorage,
Constants.MYStorage);
wordsApi.copyFolder(request);
System.out.println("Expected response type is Void: 'NewFolder' folder copied as 'NewFolder1'.");
} catch (
Exception e) {
System.err.println("Exception while calling Api:");
e.printStackTrace();
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithFolders;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.CreateFolderRequest;
import Examples.Constants;
public class CreateFolder {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
CreateFolderRequest request = new CreateFolderRequest("NewFolder", Constants.MYStorage);
wordsApi.createFolder(request);
System.out.println("Expected response type is Void: 'NewFolder' folder created.");
} catch (
Exception e) {
System.err.println("Exception while calling Api:");
e.printStackTrace();
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithDocumens;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.DocumentResponse;
import com.aspose.words.cloud.model.FieldNamesResponse;
import com.aspose.words.cloud.model.requests.CreateDocumentRequest;
import com.aspose.words.cloud.model.requests.GetDocumentFieldNamesRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class CreateNewWordDocument {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "NewDocument.docx";
String folder = null; // Document will be created at the root of the storage
CreateDocumentRequest request = new CreateDocumentRequest(Constants.MYStorage, fileName, folder);
DocumentResponse result = wordsApi.createDocument(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithDocumentProperties;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.DocumentProperty;
import com.aspose.words.cloud.model.DocumentPropertyResponse;
import com.aspose.words.cloud.model.requests.CreateOrUpdateDocumentPropertyRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class CreateOrUpdateDocumentProperty {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
String propertyName = "AsposeAuthor";
DocumentProperty prop = new DocumentProperty().builtIn(false).name(propertyName).value("Yaroslaw Ekimov");
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
CreateOrUpdateDocumentPropertyRequest request = new CreateOrUpdateDocumentPropertyRequest(fileName, propertyName, prop, null, Constants.MYStorage, null, null, null, null, null);
DocumentPropertyResponse result = wordsApi.createOrUpdateDocumentProperty(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithTables;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.BorderResponse;
import com.aspose.words.cloud.model.requests.DeleteBorderRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class DeleteBorder {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "TablesGet.docx";
Integer index = 0;
String sourcePath = "tables/1/rows/0/cells/0/";
String destName = "DeleteBorder.docx";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
DeleteBorderRequest request = new DeleteBorderRequest(fileName, sourcePath, index, null, Constants.MYStorage, null, null, destName, null, null);
BorderResponse result = wordsApi.deleteBorder(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithTables;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.BordersResponse;
import com.aspose.words.cloud.model.requests.DeleteBordersRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class DeleteBorders {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "TablesGet.docx";
String sourcePath = "tables/1/rows/0/cells/0/";
String destName = "DeleteBorders.docx";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
DeleteBordersRequest request = new DeleteBordersRequest(fileName, sourcePath, null, Constants.MYStorage, null, null, destName, null, null);
BordersResponse result = wordsApi.deleteBorders(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithComments;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.DeleteCommentRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class DeleteComment {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
Integer index = 0;
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
DeleteCommentRequest request = new DeleteCommentRequest(fileName, index, null, Constants.MYStorage, null, null, null, null, null);
wordsApi.deleteComment(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithDocumens;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.DeleteMacrosRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class DeleteDocumentMacros {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
DeleteMacrosRequest request = new DeleteMacrosRequest(fileName, null, Constants.MYStorage, null,
null, null, null, null);
wordsApi.deleteMacros(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithDocumentProperties;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.DeleteDocumentPropertyRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class DeleteDocumentProperty {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
String propertyName = "testProp";
String destName = "Out_DeleteDocumentProperty.docx";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
DeleteDocumentPropertyRequest request = new DeleteDocumentPropertyRequest(fileName, propertyName, null, Constants.MYStorage, null, null, destName, null, null);
wordsApi.deleteDocumentProperty(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithWatermark;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.DocumentResponse;
import com.aspose.words.cloud.model.requests.DeleteWatermarkRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class DeleteDocumentWatermark {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_doc.docx";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
DeleteWatermarkRequest request = new DeleteWatermarkRequest(fileName, null, Constants.MYStorage, null, null, null, null, null);
DocumentResponse result = wordsApi.deleteWatermark(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithDrawingObjects;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.DeleteDrawingObjectRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class DeleteDrawingObject {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
Integer index = 0;
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
DeleteDrawingObjectRequest request = new DeleteDrawingObjectRequest(fileName, "", index, null, Constants.MYStorage, null, null, null, null, null);
wordsApi.deleteDrawingObject(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithFields;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.DeleteFieldRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class DeleteField {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "GetField.docx";
Integer index = 0;
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
DeleteFieldRequest request = new DeleteFieldRequest(fileName, "sections/0/paragraphs/0", index, null, Constants.MYStorage, null, null, null, null, null);
wordsApi.deleteField(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithFields;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.DeleteFieldsRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class DeleteFields {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "GetField.docx";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
DeleteFieldsRequest request = new DeleteFieldsRequest(fileName, "sections/0", null, Constants.MYStorage, null, null, null, null, null);
wordsApi.deleteFields(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithFiles;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.DeleteFileRequest;
import Examples.Constants;
public class DeleteFile {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
DeleteFileRequest request = new DeleteFileRequest("NewFolder\\test_multi_pages1.docx", Constants.MYStorage, null);
wordsApi.deleteFile(request);
} catch (
Exception e) {
System.err.println("Exception while calling Api:");
e.printStackTrace();
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithFolders;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.DeleteFolderRequest;
import Examples.Constants;
public class DeleteFolder {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
DeleteFolderRequest request = new DeleteFolderRequest("NewFolder\\NewFolder1", Constants.MYStorage, true);
wordsApi.deleteFolder(request);
System.out
.println("Expected response type is Void: 'NewFolder/NewFolder1' folder deleted recusrsively.");
} catch (
Exception e) {
System.err.println("Exception while calling Api:");
e.printStackTrace();
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithFootnotes;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.DeleteFootnoteRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class DeleteFootnote {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "Footnote.doc";
Integer index = 0;
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
DeleteFootnoteRequest request = new DeleteFootnoteRequest(fileName, "", index, null, Constants.MYStorage, null, null, null, null, null);
wordsApi.deleteFootnote(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithFormFields;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.DeleteFormFieldRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class DeleteFormField {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "FormFilled.docx";
Integer index = 0;
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
DeleteFormFieldRequest request = new DeleteFormFieldRequest(fileName, "sections/0", index, null, null, null, null, null, null, null);
wordsApi.deleteFormField(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithHeaders;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.DeleteHeaderFooterRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class DeleteHeaderFooter {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "HeadersFooters.doc";
Integer index = 0;
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
DeleteHeaderFooterRequest request = new DeleteHeaderFooterRequest(fileName, "", index, Constants.MYStorage, null, null, null, null, null, null);
wordsApi.deleteHeaderFooter(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithHeaders;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.DeleteHeaderFooterRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class DeleteHeadersFooters {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "HeadersFooters.doc";
Integer index = 0;
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
DeleteHeaderFooterRequest request = new DeleteHeaderFooterRequest(fileName, "", index, Constants.MYStorage, null, null, null, null, null, null);
wordsApi.deleteHeaderFooter(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithMathObjects;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.DeleteOfficeMathObjectRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class DeleteOfficeMathObjec {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "MathObjects.docx";
Integer index = 0;
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
DeleteOfficeMathObjectRequest request = new DeleteOfficeMathObjectRequest(fileName, "", index, null, Constants.MYStorage, null, null, null, null, null);
wordsApi.deleteOfficeMathObject(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithParagraphs;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.DeleteParagraphRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class DeleteParagraph {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_doc.docx";
Integer index = 0;
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
DeleteParagraphRequest request = new DeleteParagraphRequest(fileName, "", index, null, Constants.MYStorage, null, null, null, null, null);
wordsApi.deleteParagraph(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithParagraphs;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.DeleteRunRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class DeleteRun {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "Run.doc";
Integer index = 0;
String paragraphPath = "paragraphs/1";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
DeleteRunRequest request = new DeleteRunRequest(fileName, paragraphPath, index, null, Constants.MYStorage, null, null, null, null, null);
wordsApi.deleteRun(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithTables;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.DeleteTableRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class DeleteTable {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "TablesGet.docx";
Integer index = 0;
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
DeleteTableRequest request = new DeleteTableRequest(fileName, "", index, null, Constants.MYStorage, null, null, null, null, null);
wordsApi.deleteTable(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithTables;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.DeleteTableCellRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class DeleteTableCell {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "TablesGet.docx";
Integer index = 0;
String sourcePath = "sections/0/tables/2/rows/0";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
DeleteTableCellRequest request = new DeleteTableCellRequest(fileName, sourcePath, index, null, Constants.MYStorage, null, null, null, null, null);
wordsApi.deleteTableCell(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithTables;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.DeleteTableRowRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class DeleteTableRow {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "TablesGet.docx";
Integer index = 0;
String sourcePath = "tables/1";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
DeleteTableRowRequest request = new DeleteTableRowRequest(fileName, sourcePath, index, null, Constants.MYStorage, null, null, null, null, null);
wordsApi.deleteTableRow(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithFiles;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.DownloadFileRequest;
import java.io.File;
import Examples.Constants;
public class DownloadFile {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
DownloadFileRequest request = new DownloadFileRequest("NewFolder\\test_multi_pages.docx", Constants.MYStorage, null);
File response = wordsApi.downloadFile(request);
} catch (
Exception e) {
System.err.println("Exception while calling Api:");
e.printStackTrace();
}
}
}
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.AppendDocumentRequest;
import com.aspose.words.cloud.model.DocumentEntry;
import com.aspose.words.cloud.model.DocumentEntryList;
import com.aspose.words.cloud.model.DocumentResponse;
public class merge {
public static void main(String[] args) {
// create an object of Aspose.Words Cloud API
WordsApi wordsApi = new WordsApi(new com.aspose.words.cloud.ApiClient());
com.aspose.words.cloud.ApiClient wordsClient = wordsApi.getApiClient();
wordsClient.setAppSid("xxx-xxx-xxx-xxxxx");
wordsClient.setAppKey("xxxxxxx");
// input file name
String fileName ="test_doc.docx";
try
{
// create DocumentEntry object and specify formatting for resultant file
DocumentEntry docEntry = new DocumentEntry().href("test_multi_pages.docx").importFormatMode("KeepSourceFormatting");
// list of documents to be appended
DocumentEntryList documentList = new DocumentEntryList().addDocumentEntriesItem(docEntry);
// create a request to perform document append operation
AppendDocumentRequest request = new AppendDocumentRequest(fileName, documentList, null, null,
null, null, "Combined.docx", null, null);
DocumentResponse result = wordsApi.appendDocument(request);
}catch(Exception ex)
{
System.out.println(ex.getMessage());
}
}
}
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.SplitDocumentRequest;
import com.aspose.words.cloud.model.SplitDocumentResponse;
public class SplitDocument {
public static void Run() {
WordsApi wordsApi = new WordsApi(new com.aspose.words.cloud.ApiClient());
com.aspose.words.cloud.ApiClient wordsClient = wordsApi.getApiClient();
wordsClient.setAppSid("CLINET_ID");
wordsClient.setAppKey("CLIENT_SECRET");
String fileName ="SampleFile.docx";
String format = "DOCX";
int from = 2;
int to = 4;
try
{
// call the API to split the document
SplitDocumentRequest request = new SplitDocumentRequest(fileName, format,
null, null, null, null, null, from, to, null, null);
SplitDocumentResponse result = wordsApi.splitDocument(request);
}catch(Exception ex)
{
System.out.println(ex.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithHeaders;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.HeaderFootersResponse;
import com.aspose.words.cloud.model.requests.GetHeaderFootersRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetAllHeaderFooters {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "HeadersFooters.doc";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetHeaderFootersRequest request = new GetHeaderFootersRequest(fileName, "", null, Constants.MYStorage, null, null, null);
HeaderFootersResponse result = wordsApi.getHeaderFooters(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithFonts;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.AvailableFontsResponse;
import com.aspose.words.cloud.model.requests.GetAvailableFontsRequest;
import Examples.Constants;
public class GetAvailableFonts {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
GetAvailableFontsRequest request = new GetAvailableFontsRequest(null);
AvailableFontsResponse result = wordsApi.getAvailableFonts(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithTables;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.BorderResponse;
import com.aspose.words.cloud.model.requests.GetBorderRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetBorder {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "TablesGet.docx";
String sourcePath = "sections/0/tables/2/rows/0";
Integer index = 0;
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetBorderRequest request = new GetBorderRequest(fileName, sourcePath, index, null, Constants.MYStorage, null, null);
BorderResponse result = wordsApi.getBorder(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithTables;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.BordersResponse;
import com.aspose.words.cloud.model.requests.GetBordersRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetBorders {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "TablesGet.docx";
String sourcePath = "sections/0/tables/2/rows/0";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetBordersRequest request = new GetBordersRequest(fileName, sourcePath, null, Constants.MYStorage, null, null);
BordersResponse result = wordsApi.getBorders(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithComments;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.CommentResponse;
import com.aspose.words.cloud.model.requests.GetCommentRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetComment {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
Integer index = 0;
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetCommentRequest request = new GetCommentRequest(fileName, index, null, Constants.MYStorage, null, null);
CommentResponse result = wordsApi.getComment(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithComments;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.CommentsResponse;
import com.aspose.words.cloud.model.requests.GetCommentsRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetComments {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetCommentsRequest request = new GetCommentsRequest(fileName, null, Constants.MYStorage, null, null);
CommentsResponse result = wordsApi.getComments(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.BookmarksInDocuments;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.BookmarkResponse;
import com.aspose.words.cloud.model.requests.GetBookmarkByNameRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetDocumentBookmarkByName {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
String bookmarkName = "aspose";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetBookmarkByNameRequest request = new GetBookmarkByNameRequest(fileName, bookmarkName, null, Constants.MYStorage, null, null);
BookmarkResponse result = wordsApi.getBookmarkByName(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.BookmarksInDocuments;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.BookmarksResponse;
import com.aspose.words.cloud.model.requests.GetBookmarksRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetDocumentBookmarks {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetBookmarksRequest request = new GetBookmarksRequest(fileName, null, Constants.MYStorage, null, null);
BookmarksResponse result = wordsApi.getBookmarks(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithDrawingObjects;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.DrawingObjectResponse;
import com.aspose.words.cloud.model.requests.GetDocumentDrawingObjectByIndexRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetDocumentDrawingObjectByIndex {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
Integer index = 0;
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetDocumentDrawingObjectByIndexRequest request = new GetDocumentDrawingObjectByIndexRequest(fileName, "sections/0", index, null, Constants.MYStorage, null, null);
DrawingObjectResponse result = wordsApi.getDocumentDrawingObjectByIndex(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithDrawingObjects;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.GetDocumentDrawingObjectImageDataRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetDocumentDrawingObjectImageData {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
Integer index = 0;
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetDocumentDrawingObjectImageDataRequest request = new GetDocumentDrawingObjectImageDataRequest(fileName, "sections/0", index, null, Constants.MYStorage, null, null);
File result = wordsApi.getDocumentDrawingObjectImageData(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithDrawingObjects;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.requests.GetDocumentDrawingObjectOleDataRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetDocumentDrawingObjectOleData {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "sample_EmbeddedOLE.docx";
Integer index = 0;
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetDocumentDrawingObjectOleDataRequest request = new GetDocumentDrawingObjectOleDataRequest(fileName, "sections/0", index, null, Constants.MYStorage, null, null);
File result = wordsApi.getDocumentDrawingObjectOleData(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithDrawingObjects;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.DrawingObjectsResponse;
import com.aspose.words.cloud.model.requests.GetDocumentDrawingObjectsRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetDocumentDrawingObjects {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetDocumentDrawingObjectsRequest request = new GetDocumentDrawingObjectsRequest(fileName, "sections/0", null, Constants.MYStorage, null, null);
DrawingObjectsResponse result = wordsApi.getDocumentDrawingObjects(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.MailMerge;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.FieldNamesResponse;
import com.aspose.words.cloud.model.requests.GetDocumentFieldNamesRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetDocumentFieldNames {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetDocumentFieldNamesRequest request = new GetDocumentFieldNamesRequest(fileName, null, Constants.MYStorage, null,
null, null);
FieldNamesResponse result = wordsApi.getDocumentFieldNames(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithHyperlinks;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.HyperlinkResponse;
import com.aspose.words.cloud.model.requests.GetDocumentHyperlinkByIndexRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetDocumentHyperlinkByIndex {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_doc.docx";
Integer index = 0;
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetDocumentHyperlinkByIndexRequest request = new GetDocumentHyperlinkByIndexRequest(fileName, index, null, Constants.MYStorage, null, null);
HyperlinkResponse result = wordsApi.getDocumentHyperlinkByIndex(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithDocumens;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.DocumentResponse;
import com.aspose.words.cloud.model.requests.GetDocumentRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetDocumentInfo {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetDocumentRequest request = new GetDocumentRequest(fileName, null, Constants.MYStorage, null, null);
DocumentResponse result = wordsApi.getDocument(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithParagraphs;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.ParagraphResponse;
import com.aspose.words.cloud.model.requests.GetParagraphRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetDocumentParagraph {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
Integer index = 0;
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetParagraphRequest request = new GetParagraphRequest(fileName, "", index, null, Constants.MYStorage, null, null);
ParagraphResponse result = wordsApi.getParagraph(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithParagraphs;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.ParagraphFormatResponse;
import com.aspose.words.cloud.model.requests.GetParagraphFormatRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetDocumentParagraphFormat {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
Integer index = 0;
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetParagraphFormatRequest request = new GetParagraphFormatRequest(fileName, "", index, null, Constants.MYStorage, null, null);
ParagraphFormatResponse result = wordsApi.getParagraphFormat(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithParagraphs;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.RunResponse;
import com.aspose.words.cloud.model.requests.GetRunRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetDocumentParagraphRun {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
Integer index = 0;
String paragraphPath = "paragraphs/0";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetRunRequest request = new GetRunRequest(fileName, paragraphPath, index, null, Constants.MYStorage, null, null);
RunResponse result = wordsApi.getRun(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithParagraphs;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.FontResponse;
import com.aspose.words.cloud.model.requests.GetRunFontRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetDocumentParagraphRunFont {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
Integer index = 0;
String paragraphPath = "paragraphs/0";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetRunFontRequest request = new GetRunFontRequest(fileName, paragraphPath, index, null, Constants.MYStorage, null, null);
FontResponse result = wordsApi.getRunFont(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithParagraphs;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.RunsResponse;
import com.aspose.words.cloud.model.requests.GetRunsRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetDocumentParagraphRuns {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
String paragraphPath = "sections/0/paragraphs/0";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetRunsRequest request = new GetRunsRequest(fileName, paragraphPath, null, Constants.MYStorage, null, null);
RunsResponse result = wordsApi.getRuns(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithParagraphs;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.ParagraphLinkCollectionResponse;
import com.aspose.words.cloud.model.requests.GetParagraphsRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetDocumentParagraphs {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
String paragraphPath = "sections/0";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetParagraphsRequest request = new GetParagraphsRequest(fileName, paragraphPath, null, Constants.MYStorage, null, null);
ParagraphLinkCollectionResponse result = wordsApi.getParagraphs(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithDocumentProperties;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.DocumentPropertiesResponse;
import com.aspose.words.cloud.model.requests.GetDocumentPropertiesRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetDocumentProperties {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetDocumentPropertiesRequest request = new GetDocumentPropertiesRequest(fileName, null, Constants.MYStorage, null, null);
DocumentPropertiesResponse result = wordsApi.getDocumentProperties(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithDocumentProperties;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.DocumentPropertyResponse;
import com.aspose.words.cloud.model.requests.GetDocumentPropertyRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetDocumentProperty {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
String propName = "Author";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetDocumentPropertyRequest request = new GetDocumentPropertyRequest(fileName, propName, null, Constants.MYStorage, null, null);
DocumentPropertyResponse result = wordsApi.getDocumentProperty(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithDocumentProtection;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.ProtectionDataResponse;
import com.aspose.words.cloud.model.requests.GetDocumentProtectionRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetDocumentProtection {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetDocumentProtectionRequest request = new GetDocumentProtectionRequest(fileName, null, Constants.MYStorage, null, null);
ProtectionDataResponse result = wordsApi.getDocumentProtection(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithDocumens;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.DocumentResponse;
import com.aspose.words.cloud.model.StatDataResponse;
import com.aspose.words.cloud.model.requests.GetDocumentRequest;
import com.aspose.words.cloud.model.requests.GetDocumentStatisticsRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetDocumentStatistics {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "test_multi_pages.docx";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetDocumentStatisticsRequest request = new GetDocumentStatisticsRequest(fileName, null, null, null, null,
null, null, null);
StatDataResponse result = wordsApi.getDocumentStatistics(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithFields;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.FieldResponse;
import com.aspose.words.cloud.model.requests.GetFieldRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetField {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "GetField.docx";
Integer index = 0;
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetFieldRequest request = new GetFieldRequest(fileName, "sections/0", index, null, null, null, null);
FieldResponse result = wordsApi.getField(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithFields;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.FieldsResponse;
import com.aspose.words.cloud.model.requests.GetFieldsRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetFields {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "GetField.docx";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetFieldsRequest request = new GetFieldsRequest(fileName, "sections/0", null, Constants.MYStorage, null, null);
FieldsResponse result = wordsApi.getFields(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithFolders;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.FilesList;
import com.aspose.words.cloud.model.requests.GetFilesListRequest;
import Examples.Constants;
public class GetFilesList {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
GetFilesListRequest request = new GetFilesListRequest("NewFolder\\NewFolder1", Constants.MYStorage);
FilesList response = wordsApi.getFilesList(request);
System.out.println("Expected response type is FilesList.");
} catch (
Exception e) {
System.err.println("Exception while calling Api:");
e.printStackTrace();
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithFootnotes;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.FootnoteResponse;
import com.aspose.words.cloud.model.requests.GetFootnoteRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetFootnote {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "Footnote.doc";
Integer index = 0;
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetFootnoteRequest request = new GetFootnoteRequest(fileName, "", index, null, Constants.MYStorage, null, null);
FootnoteResponse result = wordsApi.getFootnote(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-java
package Examples.WorkingWithFootnotes;
import com.aspose.words.cloud.ApiClient;
import com.aspose.words.cloud.api.WordsApi;
import com.aspose.words.cloud.model.FootnotesResponse;
import com.aspose.words.cloud.model.requests.GetFootnotesRequest;
import com.aspose.words.cloud.model.requests.UploadFileRequest;
import java.io.File;
import Examples.Constants;
public class GetFootnotes {
public static void Run() {
WordsApi wordsApi = new WordsApi(new ApiClient());
ApiClient client = wordsApi.getApiClient();
client.setAppKey(Constants.AppKey).setAppSid(Constants.AppSID);
client.setBaseUrl(Constants.BaseAPIUrl);
client.setApiVersion(Constants.ApiVersion);
try {
String fileName = "Footnote.doc";
// Upload original document to Cloud Storage
wordsApi.uploadFile(new UploadFileRequest(new File("src/main/resources/" + fileName), "", Constants.MYStorage));
GetFootnotesRequest request = new GetFootnotesRequest(fileName, "", null, Constants.MYStorage, null, null);
FootnotesResponse result = wordsApi.getFootnotes(request);
} catch (
Exception e) {
System.out.println(e.getMessage());
}
}
}