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?
-
1Any 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 Answers
Try these tools.
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.
Kabeja is a Java library for parsing, processing and converting Autodesk's DXF format
A dxf to svg converter.
Can be used to create pure svg files or Inkscape svg files with extra information like layers.
-
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
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).

- 78,642
- 66
- 377
- 442