Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section
Column
width50%
Panel
titleBGColor#B0C4DE
titleContents Summary
Table of Contents
stylenone
outlinetrue
typelist
outlinetrue
Column
width15%
 
Column
width35%
 

Introduction

This article explains how to convert CAD drawing/image to another format. You can convert CAD Drawings to BMP, PNG, JPG, JPEG, JPEG2000, TIF, TIFF, PSD, GIF, PDF and WMF formats. Aspose.CAD provides following two APIs to perform the said task:

  1. GET /cad/{name}/saveAs
  2. POST /cad/saveAs

Resource URI

Aspose.CAD Cloud APIs Swagger UI lets you call

...

these APIs directly from the browser. The description of the APIs and their parameters are also given there.

cURL Example

Option 1: Export existing drawing to another format

Input Document:  

Output Document:

Panel
bgColor#FFFFFF
Expand
titleRequest
Code Block
// First get Access Token
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -v "https://api.aspose.cloud/oauth2/token" \
-X POST \
-d 'grant_type=client_credentials&client_id=0B17F60A-6D69-426B-9ABD-79F35A6E9F7B&client_secret=53b8b19adffa41a3e87dbbd8858977ae' \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
 
// cURL example to export Drawing to another format
curl -v "https://api.aspose.cloud/v1.1/cad/910609.dxf/saveAs?format=pdf" \
-X GET \
-H "Content-Type: application/json" \
-H "Accept: multipart/form-data" \
-H "Authorization: Bearer U-VftF76H_xD29pPgwRzmhi79jZVeYsyotpGQBX95QrzO7SUBMyVlLui_0HjlC8vRgnNnAny2nywDWofm5n034boz5kBDGcjVR9q3llPKmjPwBFZ2Kh_tJe4McJu-R_aBcNNDDy7mBoDfgvlv8zdrr6XhyKpzy71SzXF51lGRN39KD2bJP4U2LYItW_I18uezfMnt6-IA2CaV21XlO5OIrosD_17isGzSuvcIoH8nXQ80tkKlbJz9o6Fq09si_d0gFXi-_qcoQrf_H1ylKkvYMJvICY6rED5IUqQuFWEbTgUcWlzfElCEzZte2I1NlKOJDa-tGi8zhMxVY_grkt2HMVbeyf58ALygfTZ7EGKvSO_wSAwY9cm_yFwEoKRXwFoUzllvRrBajU26H8SIzZ8w1KtcEYM10nNjehwirtw-dvi1RS_" \
-o 910609.pdf
Expand
titleResponse
Code Block
PDF Document 

Option 2: Export existing image to another format. Image is passed as request body

Input Document: 

Output Document:

Panel
bgColor#FFFFFF
Expand
titleRequest
Code Block
// First get Access Token
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -v "https://api.aspose.cloud/oauth2/token" \
-X POST \
-d 'grant_type=client_credentials&client_id=0B17F60A-6D69-426B-9ABD-79F35A6E9F7B&client_secret=53b8b19adffa41a3e87dbbd8858977ae' \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
 
// cURL example to export Drawing to another format. Image is passed as request body
curl -v "https://api.aspose.cloud/v1.1/cad/saveAs?format=pdf" \
-X POST \
-T 910609.dxf \
-H "Content-Type: multipart/form-data" \
-H "Accept: multipart/form-data" \
-H "Authorization: Bearer U-VftF76H_xD29pPgwRzmhi79jZVeYsyotpGQBX95QrzO7SUBMyVlLui_0HjlC8vRgnNnAny2nywDWofm5n034boz5kBDGcjVR9q3llPKmjPwBFZ2Kh_tJe4McJu-R_aBcNNDDy7mBoDfgvlv8zdrr6XhyKpzy71SzXF51lGRN39KD2bJP4U2LYItW_I18uezfMnt6-IA2CaV21XlO5OIrosD_17isGzSuvcIoH8nXQ80tkKlbJz9o6Fq09si_d0gFXi-_qcoQrf_H1ylKkvYMJvICY6rED5IUqQuFWEbTgUcWlzfElCEzZte2I1NlKOJDa-tGi8zhMxVY_grkt2HMVbeyf58ALygfTZ7EGKvSO_wSAwY9cm_yFwEoKRXwFoUzllvRrBajU26H8SIzZ8w1KtcEYM10nNjehwirtw-dvi1RS_" \
-o 910609.pdf
Expand
titleResponse
Code Block
PDF Document 

SDKs

Using an SDK (API client) is the quickest way for a developer to speed up the development. An SDK takes care of a lot of low-level details of making requests and handling responses and lets you focus on writing code specific to your particular project. Checkout our GitHub repository for a complete list of Aspose.CAD SDKs along with working examples, to get you started in no time. Please check Available SDKs article to learn how to add an SDK to your project.

SDK Examples

Option 1: Export existing drawing to another format

Panel
bgColor#FFF
Expand
titleC#
HTML
<script src="https://gist.github.com/aspose-cloud/c8bd6d4c37d5c3f13814621654f144a2.js?file=Examples-.NET-GetImageSaveAs.cs"></script>

Option 2: Export existing image to another format. Image is passed as request body

Panel
bgColor#FFF
Expand
titleC#
HTML
<script src="https://gist.github.com/aspose-cloud/c8bd6d4c37d5c3f13814621654f144a2.js?file=Examples-.NET-PostImageSaveAs.cs"></script>