LibreDWG LibreDWG is a free C library to read and write DWG files. This program is part of the GNU project, released under the aegis of GNU. It is licensed under the terms of the GNU General Public License version 3 (or at you option any later version). DWG is a file format created in the 70's for the emerging CAD applications. Currently it is the native file format of AutoCAD, a proprietary CAD program developed by AutoDesk. LibreDWG is a fork from LibDWG due to its usage of Esperanto, which we think is not the best strategy for a free software project which aims to get lots of contributors. LibreDWG is written in English. At the moment our decoder is almost done, just some R2010+ and pre-R13 entities fail to read. Among the example applications we wrote using LibreDWG is an initial SVG conversion and a DWG rewrite, i.e saveas tool. Please contact us if you can help. The program dwg2ps reads DWG and outputs Postscript for most 2D elements. It depends on pslib: <http://pslib.sourceforge.net>. In many GNU/Linux distributions, this is available by installing the pslib-dev package. If the configure script does not find pslib, dwg2ps will not be built. Sometimes we hang on our IRC channel which is #libredwg at irc.freenode.net If you don't find us there, please email the package maintainers: Reini Urban <rurban AT cpan.org> The now inactive founders and previous maintainers were: Felipe Corrêa da Silva Sanches <juca AT members.fsf.org> Rodrigo Rodrigues da Silva <pitanga AT members.fsf.org> Hardeep Singh Rai <hardeep.rai AT gmail DOT com> If you are looking for general information about the project, check our website: http://www.gnu.org/software/libredwg == Building and installing the library == You need the following dependencies: - Basic development tools (gcc/clang, autoconf, automake and libtool) - SWIG 1.7+ - Python development headers (debian: python-dev; yum: python-devel) and the libxml2 python bindings. - TeXinfo for building the docs See INSTALL for generic instructions. Basically, you do: $ ./autogen.sh (if you checked out the source code from git) $ ./configure [--enable-trace] [--enable--write] $ make $ make check # optional but strongly encouraged while LibreDWG is alpha $ sudo make install This builds and installs various files in the "installation dirs": $libdir ($exec_prefix/lib) -- library files (libredwg.*) $includedir ($prefix/include) -- dwg.h dwg_api.h $infodir ($datarootdir/info) -- LibreDWG.info Use "./configure --help" to see a full list of options you can use to customize the installation dirs. Other options recognized by configure are: --enable-trace Enable runtime tracing (default: no). When enabled, the environment variable LIBREDWG_TRACE is consulted on the first decode/encode attempt. Its value is an integer: 0 (no output) through 9 (full verbosity). --enable-write Enable write support (default: no). When enabled, you activate the write support for the dwg format. This is an experimental feature that is under construction, so it's highly unstable. == Example usage of the library == The programs and examples directories contains some application code that uses our lib: * dwgread -- A simple DWG reader. * dwgrewrite -- Reads a DWG, writes it back under a different name and optionally under a different version, and re-reads it back for confirmation. Under construction, only with --enable-write. * dwg2dxf -- Converts a DWG to a DXF (ascii or binary), optionally under a different version. Under construction. * dxf2dwg -- Converts a ascii or binary DXF to a DWG, optionally under a different version. Under construction. * load_dwg -- This is a skeleton code, reading the DWG and adding an entity. Look there if you want to have a quickly glance on how to use the library. * dwg_ps -- Opens a DWG file and outputs an PostScript file. This code depends on the PSlib library. On Debian-based systems this is usually available as a package named pslib-dev. * dwg2SVG -- Opens a DWG file and outputs an SVG (Scalable Vector Graphics) file. SVG is a W3C standard for 2d vector graphics. You can open these files on several free software tools. We recomend Inkscape, a free software vector graphics editor. The dwg2SVG program will not handle 3d content from DWG since SVG only supports 2-dimensional images. * dwgbmp -- Extracts the bmp thumbnail of a dwg file when it is available. * xmlsuite -- an extensive example library to use the SWIG python bindings is in the test/xmlsuite directory. /*****************************************************************************/ /* LibreDWG - free implementation of the DWG file format */ /* */ /* Copyright (C) 2009, 2010, 2015, 2018 Free Software Foundation, Inc. */ /* */ /* This library is free software, licensed under the terms of the GNU */ /* General Public License as published by the Free Software Foundation, */ /* either version 3 of the License, or (at your option) any later version. */ /* You should have received a copy of the GNU General Public License */ /* along with this program. If not, see <http://www.gnu.org/licenses/>. */ /*****************************************************************************/