Git Product home page Git Product logo

drawingtotext's Introduction

drawingtotext is a command line utility that extracts any text from DWG/DXF files.
Usage: drawingtotext inputfile outputfile[optional]

The input file must be a DWG or DXF file. The output file must be a .txt file. If the output file is not specified the results are sent out to the console.

Dependencies
-----------------------
- libreDWG & dxflib (how to install explained below)
- build-essential
- autoconf
- libtool
- python-dev
- swig
- texinfo

How to install LibreDWG
-----------------------
git clone git://git.sv.gnu.org/libredwg.git
sudo apt-get install build-essential
sudo apt-get install autoconf
sudo apt-get install libtool
sudo apt-get install python-dev
sudo apt-get install swig
sudo apt-get install texinfo
cd libredwg
sh autogen.sh
./configure --enable-trace
make
sudo make install
make check
(these steps are mostly taken from http://libreplanet.org/wiki/LibreDWG)


How to install dxflib
-----------------------
From the project directory...
cd dxflib
./configure && make && sudo make install


Once you've installed dxflib and LibreDWG, back up to the project directory and run "make".
This should make an execuable file named drawingtotext.

If you get a error about linking shared library LibreDWG run this command
ldconfig

Move drawingtotext to /usr/local/bin (mv drawingtotext /usr/local/bin) so it can be accessed via the command line from anywhere.
	- Down the road we will hopefully modify the makefile to have an install command.



Misc
-----------------------
This is mainly just a copy of the text extraction process from the following code:
http://www.ibm.com/developerworks/library/os-autocad/#download

The code could probably have a lot of lines(and maybe whole files) removed, I haven't really gone through everything yet so I don't know what's required for the text extraction and what's not.

drawingtotext's People

Contributors

davidworkman9 avatar dwvisser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

drawingtotext's Issues

Unable to build on Ubuntu 16.04

OS: Ubuntu 16.04

After successfully installing dxflib, running make from within the root of this project throws this error:

ubuntu@fm-dev:/tmp/drawingtotext$ sudo make
g++ -ggdb -o drawingtotext OutputFormatText.cpp OutputFormatConsole.cpp OutputFormatTypes.cpp InputFormatDXF.cpp GetInsertions.cpp InputFormatDWG.cpp AutoCADConverter.cpp -ldxflib -I/usr/include/gdal -lredwg
/tmp/ccsMEcLL.o: In function `InputFormatDXF::InputFormatDXF(char const*)':
/tmp/drawingtotext/InputFormatDXF.cpp:7: undefined reference to `DL_Dxf::in(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, DL_CreationInterface*)'
/tmp/ccsMEcLL.o: In function `InputFormatDXF::readFeaturesInto(OutputFormat*)':
/tmp/drawingtotext/InputFormatDXF.cpp:34: undefined reference to `DL_Dxf::in(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, DL_CreationInterface*)'
collect2: error: ld returned 1 exit status
Makefile:2: recipe for target 'drawingtotext' failed
make: *** [drawingtotext] Error 1

Installation of dependencies on OSX

How do I install the dependencies for this on OSX?

I tried running make, and it complained about dwg.h, which I assume is related to libreDWG. I couldn't find anything for libreDWG on OSX.

$ make
g++ -ggdb -o drawingtotext OutputFormatText.cpp OutputFormatConsole.cpp OutputFormatTypes.cpp InputFormatDXF.cpp GetInsertions.cpp InputFormatDWG.cpp AutoCADConverter.cpp -ldxflib -I/usr/include/gdal -lredwg
In file included from InputFormatDWG.cpp:1:
./InputFormatDWG.h:11:11: fatal error: 'dwg.h' file not found
        #include <dwg.h>
                 ^
1 error generated.
In file included from AutoCADConverter.cpp:2:
./InputFormatDWG.h:11:11: fatal error: 'dwg.h' file not found
        #include <dwg.h>
                 ^
1 error generated.
make: *** [drawingtotext] Error 1
$

Please note this is very low importance - I don't need to use drawingtotext myself, I'm just trying to run the tests for the npm package textract (dbashford/textract).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.