Apache POI - HDGF and XDGF - Java API To Access Microsoft Visio Format Files
Overview
Overview
HDGF is the POI Project's pure Java implementation of the Visio binary (VSD) file format. XDGF is the POI Project's pure Java implementation of the Visio XML (VSDX) file format.
Currently, HDGF provides a low-level, read-only api for accessing Visio documents. It also provides a way to extract the textual content from a file.
At this time, there is no usermodel api or similar, only low level access to the streams, chunks and chunk commands. Users are advised to check the unit tests to see how everything works. They are also well advised to read the documentation supplied with vsdump to get a feel for how Visio files are structured.
To get a feel for the contents of a file, and to track down where data of interest is stored, HDGF comes with VSDDumper to print out the contents of the file. Users should also make use of vsdump to probe the structure of files.
Steps required for write support
Currently, HDGF is only able to read visio files, it is not able to write them back out again. We believe the following are the steps that would need to be taken to implement it.
- Re-write the decompression support in LZW4HDGF as HDGFLZW, which will be much better documented, and also under the ASL. Completed October 2007
- Add compression support to HDGFLZW. In progress - works for small streams but encoding goes wrong on larger ones
- Have HDGF just write back the raw bytes it read in, and have a test to ensure the file is un-changed.
- Have HDGF generate the bytes to write out from the Stream stores, using the compressed data as appropriate, without re-compressing. Plus test to ensure file is un-changed.
- Have HDGF generate the bytes to write out from the Stream stores, re-compressing any streams that were decompressed. Plus test to ensure file is un-changed.
- Have HDGF re-generate the offsets in pointers for the locations of the streams. Plus test to ensure file is un-changed.
- Have HDGF re-generate the bytes for all the chunks, from the chunk commands. Tests to ensure the chunks are serialized properly, and then that the file is un-changed
- Alter the data of one command, but keep it the same length, and check visio can open the file when written out.
- Alter the data of one command, to a new length, and check that visio can open the file when written out.
by POI Developers