1. Products
  2.   CAD
  3.   JavaScript
  4.   Aspose.CAD for JavaScript

Aspose.CAD for JavaScript


JavaScript API to Create & Convert AutoCAD Files

Open Source JavaScript API for Exporting AutoCAD DWG, DXF, DWF, DXB & STL drawing to PDF & Raster Images (BMP, GIF, JPG & JPEG) without any dependencies.

CAD (Computer-Aided Design) files are widely used in various leading industries, including architecture, engineering, and manufacturing. The ability to manipulate CAD files programmatically is essential for automating processes, extracting data, and integrating CAD functionality into desktop as well as web applications. Aspose.CAD for JavaScript API emerges as a very reliable solution, providing software developers with a powerful and versatile library to work with CAD files seamlessly within JavaScript-based applications.

Aspose.CAD for JavaScript API is a feature-rich library that supports a wide range of CAD formats, including DWG, DXF, DWT, DGN, DWF, DWFX, IFC, STL, IGES, PLT, CF2, OBJ, HPGL, IGS, and more. There are several important features part of the library such as creating new CAD files, modifying existing diagrams, rendering CAD files in various formats, viewing CAD files directly within web applications, accessing and manipulating individual layers, manipulating CAD entities programmatically, better security and integrity of CAD files, geometry operations support, extracting metadata information from CAD files and many more.

Aspose.CAD for JavaScript API is a cutting-edge JavaScript library developed by the Aspose team and has included a very advanced CAD conversion native API that allows software developers to convert popular CAD file formats like DXF, DWG, DWT, DGN, IFC, DWF, DWFX, STL, IGES(IGS), CF2, Collada(DAE), PLT, OBJ, SVG, DXB, FBX, U3D, 3DS, and STP files to raster image formats as well as PDF file format without any software dependencies. With its extensive feature set, cross-platform compatibility, and ease of integration, the Aspose.CAD API opens up new possibilities for CAD-related tasks in industries such as engineering, architecture, and manufacturing.

Previous Next

Getting Started with Aspose.CAD for JavaScript

The recommend way to install Aspose.CAD for JavaScript is using NPM. Please use the following command for a smooth installation.

Install Aspose.CAD for JavaScript via NPM

npm install aspose-cad 

You can download the library directly from Aspose.CAD for JavaScript product page

CAD File Conversion to Other Formats via JavaScript

Aspose.CAD for JavaScript makes it easy for software developers to load and convert nemours CAD file formats to other supported file formats using JavaScript API. The API allows conversion of AutoCAD DXF, DWG, DWT, DGN, IFC, DWF, DWFX, STL, PLT, OBJ, SVG, DXB, FBX, U3D, 3DS, STP files to PDF and Raster images like GIF, TIFF, JPEG, PNG, PSD, BMP, DICOM, Webp, EMF, WMF, SVG & so on. This feature is useful when you need to generate reports, share CAD files with non-CAD users, or incorporate CAD data into different systems. The following example shows how software developers can convert DWG Format to PNG inside JavaScript applications.

How to Export DWG Format to PNG via JavaScript?

async onFileSelected(event) {
 const file: File = event.target.files[0]; //file.dwg
 file.arrayBuffer().then(async buff => {
  let x = new Uint8Array(buff);
  this.imgFile = await Image.load(x);
  var exportedFile = await Image.save(this.imgFile, new PngOptions());
  var blob = new Blob([exportedFile], { type: 'application/octet-stream' });

CAD Geometry Operations via JavaScript API

Aspose.CAD for JavaScript has provided support for various operations for programmatically handling geometry operations inside JavaScript applications. The API provides various geometry operations, allowing software developers to perform tasks like scaling, rotation, translation, merging, copying, mirroring, and more on CAD entities. This functionality is crucial for modifying CAD files programmatically. Moreover, the API allows manipulating CAD entities programmatically, such as lines, arcs, circles, text, dimensions, and more.

AutoCAD Layer and Layout Support

Aspose.CAD for JavaScript API provides comprehensive support for working with layers and layouts. You can create, modify, and delete layers, as well as manage layouts within CAD files. This feature is particularly useful when dealing with complex CAD projects that involve multiple layers and layouts. Software developers can easily access and manipulate individual layers within CAD files using the API and supports tasks like hiding specific layers, changing layer properties, or extracting layer-specific data.

Read & Extract CAD Metadata via JavaScript

Aspose.CAD for JavaScript enable software developers to access AutoCAD metadata information with just a couple of lines of JavaScript code. The API enables programmers to easily retrieve information about layers, blocks, entities, dimensions, and other properties, enabling them to analyze and process CAD files programmatically. Moreover, developers can also extract metadata information from CAD files, such as author details, creation date, and modification history. This information can be utilized for documentation, analysis, or further processing.