« Previous -
Version 8/10
(diff) -
Next » -
Current version
Mark Swain, 06/13/2011 04:51 pm
Using WebODF for viewing documents on a web server¶
To deploy WebODF on a webserver one needs to check out the code from the git repository at
http://git.gitorious.org/odfkit/webodf.git
or download a code package from
http://gitorious.org/odfkit/webodf/archive-tarball/master
Referencing WebODF from your content¶
New directions as of 2011-06-12¶
Use webodf.js and webodf.css
<link rel="stylesheet" type="text/css" href="webodf.css"/>
<script src="webodf.js" type="text/javascript" charset="utf-8"></script>
function init() {
var url = "myurl.odt",
odfelement = document.getElementById("odf"),
odfcanvas = new odf.OdfCanvas(odfelement);
odfcanvas.load(url);
}
</script>
<title></title>
</head>
<body onload='init()' >
<div id="odf"></div>
</body>
webodf.js and webodf.css are located in the folder webodf and are the only two
files you need.
Previous directions¶
Copy these these two files and this directory from the directory webodf to your server:
odf.html defaultodfstyle.css lib/
and add your ODF files. E.g. you can store the files in a directory called odf. The directory odf should be in the same folder as the file odf.html.
If this directory contains a file 'HelloWorld.odt' you can view it by entering this url in your browser:
http://example.com/path/odf.html#odf/HelloWorld.odt
Replace http://example.com/path/ to the right path for your server.