Introduction
Welcome to the documentation for the Aspose Cloud SDK! This software development kit allows you to seamlessly integrate Aspose Cloud services into your applications.
What is Aspose Cloud?
Aspose Cloud is a cloud-based service provided by Aspose that offers a wide range of powerful document manipulation features. It allows developers to perform tasks such as creating, editing, converting, and manipulating various file formats including documents, spreadsheets, presentations, emails, and images. Aspose Cloud supports popular programming languages like Java, .NET, Python, Ruby, and many more.
Features
- Document creation: Create new documents with various file formats.
- Document editing: Modify existing documents by adding, editing, or deleting content.
- Document conversion: Convert documents between different formats.
- Document merging: Combine multiple documents into one.
- Document splitting: Split a document into multiple smaller documents.
- Document encryption: Protect sensitive information by encrypting documents.
- Document metadata manipulation: Edit or extract metadata information from documents.
- Document signing: Apply digital signatures to documents for authentication.
- Document watermarking: Add text or image watermarks to documents.
- Document OCR: Extract text from scanned documents using OCR.
- And more!
SDK Installation
To get started with the Aspose Cloud SDK, follow these steps:
- Download the SDK from our GitHub repository.
- Include the SDK in your project by copying the necessary files.
- Import the required classes/interfaces for your desired functionality.
- Start using the Aspose Cloud services in your application.
Getting API Keys
In order to use the Aspose Cloud services, you need to obtain the API keys. Follow these steps to get API keys:
- Go to the Aspose Cloud dashboard and sign in (or sign up if you don’t have an account).
- Create a new application by providing a name and description.
- Once your application is created, you will be provided with the API keys (Client ID and Client Secret).
- Use these API keys in your application to authenticate and access the Aspose Cloud services.
Code Examples
Here are some code examples showcasing the usage of the Aspose Cloud SDK:
“`php
// PHP code example
require_once(‘vendor/autoload.php’);
$config = new \Aspose\Cloud\Config();
$config->setAppSID(‘YOUR_APP_SID’);
$config->setAppKey(‘YOUR_APP_KEY’);
// Create a new instance of the desired service
$wordsApi = new \Aspose\Cloud\WordsApi($config);
// Perform document manipulation operations
$response = $wordsApi->convertDocument([
‘format’ => ‘pdf’,
‘file’ => ‘/path/to/input.docx’
]);
// Handle the response
if ($response->getStatus() === ‘OK’) {
// Document conversion was successful
$outputFilePath = $response->getOutputFilePath();
echo “Conversion successful. Output file: $outputFilePath”;
} else {
// An error occurred
echo “Conversion failed. Error: {$response->getMessage()}”;
}
“`
“`java
// Java code example
import com.aspose.cloud.sdk.common.Product;
import com.aspose.cloud.sdk.common.Utils;
import com.aspose.cloud.sdk.words.api.WordsApi;
import com.aspose.cloud.sdk.words.model.SaveDocumentRequest;
// Set Aspose Cloud API credentials
Product.setClientId(“YOUR_CLIENT_ID”);
Product.setClientSecret(“YOUR_CLIENT_SECRET”);
Utils.setProductBaseUrl(“https://api.aspose.cloud”);
// Create a new instance of the desired service
WordsApi wordsApi = new WordsApi();
// Perform document manipulation operations
SaveDocumentRequest saveDocumentRequest = new SaveDocumentRequest();
saveDocumentRequest.setFormat(“pdf”);
saveDocumentRequest.setFileName(“/path/to/input.docx”);
String outputFilePath = wordsApi.saveDocument(saveDocumentRequest);
// Handle the response
if (!outputFilePath.isEmpty()) {
// Document conversion was successful
System.out.println(“Conversion successful. Output file: ” + outputFilePath);
} else {
// An error occurred
System.out.println(“Conversion failed. Error: ” + wordsApi.getErrorMessage());
}
“`
// Add more code examples as required
“`
Conclusion
With the Aspose Cloud SDK, you can easily leverage the power of Aspose Cloud services to enhance your document manipulation workflows. Its comprehensive features and extensive language support make it a valuable tool for developers working with different file formats. Get started with the SDK today and unlock the full potential of Aspose Cloud!