A C++ tool for inspecting Open Document Format (ODF) files, useful for LibreOffice development and debugging.
ODF (Open Document Format) is an open standard for office documents (text, spreadsheets, presentations). Files include:
.odt- Text documents.ods- Spreadsheets.odp- Presentations.odg- Graphics
ODF files are ZIP archives containing XML files and resources.
- Extract and list all files in an ODF archive
- Display XML content with pretty formatting
- Show document metadata (content.xml, meta.xml, styles.xml)
- Inspect manifest and document structure
- Useful for understanding ODF structure before contributing to LibreOffice
- C++17 compatible compiler (GCC, Clang, MSVC)
- CMake 3.15 or higher
- zlib library
- libxml2 library
vcpkg install zlib libxml2
cmake -B build -DCMAKE_TOOLCHAIN_FILE=[vcpkg-root]/scripts/buildsystems/vcpkg.cmake
cmake --build build# Install dependencies
# Ubuntu/Debian:
sudo apt-get install zlib1g-dev libxml2-dev
# macOS:
brew install zlib libxml2
# Build
mkdir build && cd build
cmake ..
make./odf-inspector <path-to-odf-file>Examples:
./odf-inspector document.odt
./odf-inspector spreadsheet.ods
./odf-inspector presentation.odpodf-inspector/
├── include/ # Header files
│ ├── ODFInspector.h
│ └── ZipReader.h
├── src/ # Implementation files
│ ├── main.cpp
│ ├── ODFInspector.cpp
│ └── ZipReader.cpp
├── CMakeLists.txt # Build configuration
└── README.md
- ZIP Extraction: ODF files are ZIP archives, so we use zlib to extract contents
- XML Parsing: Extract and parse key XML files (content.xml, meta.xml, styles.xml)
- Display: Pretty-print the structure and metadata
mimetype- Identifies the ODF document typecontent.xml- Main document contentmeta.xml- Document metadata (author, date, etc.)styles.xml- Style definitionssettings.xml- Application settingsMETA-INF/manifest.xml- File manifestPictures/- Embedded images
This tool helps you:
- Understand ODF file structure
- Debug document issues
- Test file generation
- Learn the format before contributing to LibreOffice core
MIT License - Feel free to use and modify for your LibreOffice contribution work!..