20

I am looking for a library, which can convert CAD files(DWG, DXF) into SVG format. The library should be able to run on Linux platform. Can anyone tell me which library can do this?

Joe SHI
  • 1,734
  • 4
  • 20
  • 39
  • 1
    Any chance you have already looked at some of the ones that google fines when you type "linux convert dxf to svg" - admittedly none of them appear to be JAVA - but I'm not sure how strong a requirement that is, or if it's OK to fork a process and run some external tool if that is helpful? – Mats Petersson Dec 26 '12 at 03:07
  • I think he got a point: I don't find it on Google. – Ramy Al Zuhouri Dec 26 '12 at 03:37

2 Answers2

7

Try these tools.

  1. http://etc.nkadesign.com/Download/Cad2svg

cad2svg is a simple Linux command-line utility that automatically converts AutoCAD files (both dwg and dxf) to SVG

This link is not working anymore:

2) http://davinder.in/blog/how-install-libredwg-ubuntu

GNU LibreDWG is a free C library to handle DWG files.

  1. http://kabeja.sourceforge.net/

Kabeja is a Java library for parsing, processing and converting Autodesk's DXF format

  1. http://sourceforge.net/projects/dxf-svg-convert

A dxf to svg converter.
Can be used to create pure svg files or Inkscape svg files with extra information like layers.

Community
  • 1
  • 1
Jirilmon
  • 1,924
  • 1
  • 12
  • 13
  • notice that **cad2svg** no more available for download, and for **dwf2svg-inkscape** it seems that **dxf2svg-0.1.zip** download is invalid. – boly38 Mar 09 '17 at 15:27
6

The OpenDesignAlliance currently provides the only useful implementation of such a thing.
You want Theiga and Theiga for .NET and Java .

In 2013, ODA used the Java support provided by SWIG to create "Teigha for Java".
Teigha for Java includes the following:

  • Java access to the full Teigha API for both .dwg and .dgn files.
  • Support for Windows, Linux and Mac platforms. API very similar to Teigha.NET, simplifying the transition between languages.

Also, if you're using C#, WoutWare CadLib would be a very good fully managed commercial option for converting DWG/DXF to SVG (while preserving layers). And it also works on Linux and Mac with .NET-Core (no native binaries required).

Stefan Steiger
  • 78,642
  • 66
  • 377
  • 442