libvisio
TDF LibreOffice Document Liberation Project Community Blogs Weblate Nextcloud Redmine Ask LibreOffice Donate
Microsoft Visio import library | |
---|---|
The Document Liberation Project | |
Development status | Stable |
License | MPL 2.0 |
Maintainers | David Tardon (dtardonredhat.com) Eilídh McAdam (tibbylicklegmail.com) Fridrich Strba (fridrich.strbabluewin.ch) |
Repository | git://gerrit.libreoffice.org/libvisio |
Sources | http://dev-www.libreoffice.org/src/libvisio |
Libvisio is a library that parses the file format of Microsoft Visio documents of all versions.
Getting the sources
libvisio sources are stored in git. To get them, you can use:
git clone git://gerrit.libreoffice.org/libvisio
or you can browse the code online.
Source tarballs of all released versions can be found here.
Building the code
You will need these tools and libraries to build libvisio:
sudo apt install build-essential automake libcppunit-dev autotools-dev libtool libboost-dev gperf librevenge-dev libxml2 perl doxygen libxml2-dev libicu-dev libcppunit-dev
Once you have the source code and the dependencies, you can proceed to build. To do that, run the customary sequence of commands in the source code directory:
./autogen.sh ''# only needed for building from git''
./configure --enable-debug --enable-werror --without-docs
make
To run tests you could type command:
make check
To install library in /usr/local/
directory (e.g. /usr/local/lib/libvisio-0.1.so
):
make install
To configure and build LibreOffice, to use locally installed libvisio
:
./autogen.sh --with-system-libvisio
make
Before installing, to avoid running with super user provileges, try to change user to current:
sudo chown -R $USER /usr/local
Contributing
Hacking
There are several ways to analyse Visio files:
- for binary format (.vsd) OLE Toy could be used
- for Office Open XML (OOXML) XML files (.vsdx), the Chromium/Chrome extension could be used
- for analasing from Visio, enabling Developer mode is recommended (Open the File tab, Options, Advanced, and under General, select Run in developer mode). After that the Developer tab will be available, as shown here.
The information about LibreOffice Draw file format is available here.
Documentation about Visio file format (.vsdx) is available at Microsoft page and in official Microsoft documentation
The information how to setup development environment is available at: libvisio-setup
Workflow
librevenge
tries to give a C++ API which mostly maps to flat ODF 1:1. It means that most complexity can be figured out by:
- Manually construct an image and save it as
Flat XML ODF Drawing (.fodg)
that does what you want (hand-edit, import into Draw, check the result, goto 1). - Once you know what ODG you want to generate, tweak
libvisio
to emitlibrevenge
calls that generate the ODG you want.
Integration to repository
Once you have made a change that you are happy with, contribute it back, we'll be happy to integrate it!
Submit it to gerrit. How to work with gerrit is described here.
To push to review:
git push ssh://gerrit.libreoffice.org:29418/libvisio HEAD:refs/for/master
Samples of Visio Documents
Samples of Drawind, Stensils and Templates could be downloaded from:
- libvisio regression sample.
- Microsoft Samples.
- VSDX/VSD documents
- Cisco Visio Stensils
- VisioCafe Stensils