How to Convert DWG to JPG in C#

In this elaborative example, we’ll see how to convert DWG to JPG in C#. The Autocad export to JPG using C# can be easily done by using Aspose.CAD for .NET API. In this tutorial, we will learn how to export Autocad DWG to JPG using C#. By using Aspose.CAD in C#, save Autocad as Jpeg in both multiple colors as well as single colored form.

Steps to Export DWG to JPG in C#

  1. Get Aspose.CAD for .NET package from NuGet.org
  2. Include Aspose.CAD and Aspose.CAD.FileFormat namespaces in your code
  3. Load Aspose.CAD license using SetLicense method
  4. Load source DWG for export to JPEG using Image class
  5. Set rasterization options for desired JPEG file
  6. Save the DWG to JPEG exported image on disc

The DWG file format for CAD (Computer Aided Design) drawings contain 2D and 3D design data in binary format data. It comprise of vector images and metadata for holding contents of CAD files. This example is about DWG to JPEG using C# but it can be used for DXF or DGN file formats as well.

Code for Autocad export to JPG using C#

In our previous topic, we demonstrated, How to Extract Text from DXF file in C#. In afore mentioned topic, we have used C# code sample to export DWG to JPEG. In this whole process to save Autocad file to JPG, you do not need to install Autocad on your system and the API works seamlessly in any form of C# application including Web, Desktop, and ASP.NET etc.

 English