纯Java读取、显示、转换word文档(97~2007)、html文档
纯Java读取、显示、转换word文档(97~2007)、html文档
下载程序库
http://hgsqldoc.appspot.com/lib/hg.jar
主程序库(必须)
http://hgsqldoc.appspot.com/lib/poi.jar
解析doc格式
http://hgsqldoc.appspot.com/lib/itext.jar
输出pdf和rtf
http://hgsqldoc.appspot.com/lib/fgio.jar
输出svg、swf、ps、emf
读取
com.hg.doc.DocApi.open()
例如:
DocApi.open("c:/a.doc");
DocApi.open(new FileInputStream("c:/a.doc"),
DocApi.OPEN_FORMAT_DOC);
转换
com.hg.doc.DocApi.writeAs()
例如:
DocApi.writeAs(DocApi.open("c:/a.doc"),
new FileOutputStream("c:/a.pdf"),
DocApi.FORMAT_PDF);
显示
new com.hg.doc.DocViewer()
例如:
JFrame f = new JFrame("XDOC浏览器");
DocViewer viewer = new DocViewer();
//viewer.open("c:/a.doc");
f.getContentPane().add(viewer);
f.setSize(800, 600);
f.setVisible(true);
相关文档:
The Java virtual machine defines various runtime data areas that are used during execution of a program. Some of these data areas are created on Java virtual machine start-up and are destroyed only when the Java virtual machine exits. Other data areas are per thread. Per-thread data areas are create ......
Java编程时,为类DialogTry2添加关闭窗口事件,我在构造方法中采用事件适配器来实现:
this.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
&nbs ......
[转帖]Java学习之路:不走弯路,就是捷径
2007-04-11 16:10
在ChinaITLAB导师制辅导中,笔者发现问得最多的问题莫过于"如何学习编程?Java该如何学习?"。类似的问题回答多了,难免会感觉厌烦,就萌生了写下本文的想法。到时候再有人问起类似的问题,我可以告诉他(她),请你去看看《Java学习之路》。拜读过台湾蔡学镛先 ......
在CSDN中看到了个有关java技巧的帖子,觉得非常有用,可以避免开发过程中产生的一些低级的错误,帖子本身已经进行了总结,我挑出了其中一些个人觉得平时开发过程中有用的部分,再加上自己在工作中学到的技巧,整理在本文中,并随着时间实时更新
1、写好注释。输入参数、输出类型、方法功能,把这三点描 ......
基本概念:
PermGen space:全称是Permanent Generation space。就是说是永久保存的区域,用于存放Class和Meta信息,Class在被Load的时候被放入该区域
Heap space:存放Instance。 GC(Garbage Collection)应该不会对PermGen space进行清理
所以如果你的APP会LOAD很多CLASS的话,就很可能出现PermGen space错误
Java Hea ......