slashmais slashmais - 1 month ago 12
C Question

Libraries for .odt formatting

Are there any C/C++ libraries available that can be used in creating, loading and saving files in .odt-format?

Alternatively, where can I find tutorial-like information on implementing .odt(/ODF) specifications?

Answer

This site: OASIS OpenDocument Essentials seems to cover the problem, including howto-examples and shortcuts.
It's quite nicely done and easy to follow.

Flexibility can be perceived as complexity. If you don't need the flexibility, create a template ODT and just fill in the content as needed. As mentioned, there exist XML parsers to actually handle IO. ODT isn't a plaintext file, so some complexity/difficulty is expected. – Ioan

From the link:

The Virtues of Cheating

As you begin to work with OpenDocument files, you may want to write a program that constructs a document with some feature that isn’t explained in this book—this is, after all, an “essentials” book. Just start OpenOffice.org or KOffice, create a document that has the feature you want, unpack the file, and look for the XML that implements it. To get a better understanding of how things works, change the XML, repack the document, and reload it. Once you know how a feature works, don’t hesitate to copy and paste the XML from the OpenDocument file into your program. In other words, cheat. It worked for me when I was writing this book, and it can work for you too!

Comments