WebODF is a javascript library to open and edit open document format files.
It provides an API to modify and format documents online in a browser using a Javascript API built on top of basic Javascript DOM editing and modifications. The library supports .odt, .ods, .odp among many other file formats. Also saving of files with custom fonts and styles for elements, image addition are some of the key features.
Basic usage is as follows:
<html>
<head>
//Include the webodf library..
//Use webodf-debug.js(unminified) if you want to debug the webODF Api on your own..
<script src="webodf.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
function init() {
var odfelement = document.getElementById("odf"),
//globally exposed 'odf' object by webodf library
odfcanvas = new odf.OdfCanvas(odfelement);
// Load your Open Document Format File ..The file should be located on server and accessible using a valid path e.g : ../resources/docs/myodt.odt
odfcanvas.load("myfile.odt");
}
window.setTimeout(init, 0);
</script>
</head>
<body>
<div id="odf"></div>
</body>
</html>
The Source code for webodf can be found on github page here.