OpenOffice 的 Java 类库 jOpenDocument
fmms
13年前
<p>jOpenDocument 是一个用来处理 OpenOffice.org 文档的 Java 类库,无需 OpenOffice 的支持。</p> <p>使用 jOpenDocument 你能够:</p> <p>* 动态创建文档<br /> * 显示和打印文档<br /> * 对文档进行切分、联合等操作<br /> * 模版填充<br /> * 通过 ScriptEngine 接口来使用最熟悉的编程语言</p> <p>例如通过下面代码直接可以打开一个文档</p> <p><code><span style="color:#7f0055;"><strong>final </strong></span><span style="color:#000000;">OpenDocument doc = </span><span style="color:#7f0055;"><strong>new </strong></span><span style="color:#000000;">OpenDocument</span><span style="color:#000000;">()</span><span style="color:#000000;">;</span><br /> <span style="color:#ffffff;"> </span><span style="color:#000000;">doc.loadFrom</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">"invoice.ods"</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br /> <br /> <span style="color:#ffffff;"> </span><span style="color:#3f7f5f;">// Show time !</span><br /> <span style="color:#ffffff;"> </span><span style="color:#7f0055;"><strong>final </strong></span><span style="color:#000000;">JFrame f = </span><span style="color:#7f0055;"><strong>new </strong></span><span style="color:#000000;">JFrame</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">"Invoice Viewer"</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br /> <span style="color:#ffffff;"> </span><span style="color:#000000;">ODSViewerPanel viewer = </span><span style="color:#7f0055;"><strong>new </strong></span><span style="color:#000000;">ODSViewerPanel</span><span style="color:#000000;">(</span><span style="color:#000000;">doc</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br /> <span style="color:#ffffff;"> </span><span style="color:#000000;">f.setContentPane(viewer);</span><br /> <span style="color:#ffffff;"> </span><span style="color:#000000;">f.pack();</span><br /> <span style="color:#ffffff;"> </span><span style="color:#000000;">f.setVisible(</span><span style="color:#7f0055;"><strong>true</strong></span><span style="color:#000000;">);</span></code></p> <p><img alt="OpenOffice 的 Java 类库 jOpenDocument" src="https://simg.open-open.com/show/8366bdb8e4272f5b2127ff47ffe54e99.png" width="392" height="280" /><br /> <br /> </p> <p><strong>项目主页:</strong><a href="http://www.open-open.com/lib/view/home/1326898535687" target="_blank">http://www.open-open.com/lib/view/home/1326898535687</a></p>