No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.swagger-codegen
ReferenceData
TestData
env
src
.gitignore
.swagger-codegen-ignore
LICENSE
README.md
aspose-cad-cloud.iml
pom.xml

README.md

Aspose.CAD for Cloud Java SDK

Aspose.CAD for Cloud is a true REST API that enables you to perform a wide range of drawing processing operations including manipulation and conversion in the cloud, with zero initial costs. Our Cloud SDKs are wrappers around REST API in various programming languages, allowing you to process images in language of your choice quickly and easily, gaining all benefits of strong types and IDE highlights.

This repository contains Aspose.CAD for Cloud Java SDK source code. This SDK allows you to work with Aspose.CAD for Cloud REST APIs in your Java applications quickly and easily, with zero initial cost.

To use this SDK, you will need App SID and App Key which can be looked up at Aspose Cloud Dashboard (free registration in Aspose Cloud is required for this).

The solution is updated using code generator.

Example

// optional parameters are base URL, API version, authentication type and debug mode
// default base URL is https://api.aspose.cloud/
// default API version is v1
// default authentication type is OAuth2.0
// default debug mode is false
CADApi CADApi = new CADApi("yourAppKey", "yourAppSID");

// this GET request converts drawing files
// nullable parameters are input file folder, Aspose storage name (if you have more than one storage and want to use non-default one), rasterization options and output file path 
// if output file path is not set, resulting image is returned in a stream; otherwise, it's saved at the specified path in the storage and null is returned
GetImageSaveAsRequest getSaveRequest = new GetImageSaveAsRequest("inputDrawing.dxf", "png", "InputFolder", null, null, "ResultFolder/resultImage.png");

// returns ApiResponse with null response data value, saves result to storage
CADApi.getImageSaveAs(getSaveRequest);

GetImageSaveAsRequest getStreamRequest = new GetImageSaveAsRequest("inputDrawing.dwg", "png", "InputFolder", null, null, null);

// returns ApiResponse with resulting image bytes
ApiResponse apiResponse = CADApi.getImageSaveAs(getStreamRequest);

// process resulting bytes
byte[] responseData = apiResponse.getResponseData();

// another option is to use POST request and send image in a stream, if it's not present in your storage

InputStream inputStream = null;
byte[] inputBytes = null;
try
{
	File inputFile = new File("D:\\test\\localInputImage.dwg");
	inputBytes = new byte[(int) inputFile.length()];
	inputStream = new FileInputStream(inputFile);
	inputStream.read(inputBytes);
}
finally
{
	if (inputStream != null)
	{
		inputStream.close();
	}
}

PostImageSaveAsRequest postSaveRequest = new PostImageSaveAsRequest(inputBytes, "png", null, "ResultFolder/resultImage.png", null);
	
// returns ApiResponse with null response data value, saves result to storage
CADApi.postImageSaveAs(postSaveRequest);

PostImageSaveAsRequest postStreamRequest = new PostImageSaveAsRequest(inputBytes, "png", null, null, null);
	
// returns ApiResponse with resulting image bytes
apiResponse = CADApi.postImageSaveAs(postStreamRequest);

// process resulting bytes
responseData = apiResponse.getResponseData();

// another requests typically follow the same principles

Tests

Tests from this repo are intended for internal usage only.

Licensing

All Aspose.CAD for Cloud SDKs, helper scripts and templates are licensed under MIT License.

Contact Us

Your feedback is very important to us. Please feel free to contact via

Resources