Generating an ODF document in PHP
Sometimes, you have to generate some kind of document, a commercial offer for example, based on some data that has been entered into some HTML form, and you want it to remain editable, so a PDF document is not the solution. You may consider generating an HTML document, but you quickly realize that you want something that is easily editable by your HTML-illitterate co-worker. Using OpenDocument would be an excellent choice.
Since you know that an ODF file is “just zipped xml”, you may think that creating the file from scratch is the way to go. A better way, if the document has any complexity in it, is to start from some template, and with a few instructions change it into your final document.
A quick search reveals a few tools that can be used in this way. The one is suiting me best now is OpenTBS, which is a plugin for the “TinyButStrong” PHP template engine. It seems easy to use: You set a few “anchors” in your template, a few variables in your PHP code, and it works. It is flexible enough that you can change values in the formulae inside table cells, add rows to tables, link pictures and so on. The TBS template engine is just one PHP file, and OpenTBS another PHP file. It can’t really get any simpler than this.
As a side note, I wonder if there is any WordPress plugin to export blog entries as an ODF document. Could it be useful to convert an entire blog to a still-editable book?