易截截图软件、单文件、免安装、纯绿色、仅160KB

纯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);


相关文档:

java 虚拟机运行时数据区域 Runtime Data Areas

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内部类访问外部对象的方法

  Java编程时,为类DialogTry2添加关闭窗口事件,我在构造方法中采用事件适配器来实现:
    this.addWindowListener(new WindowAdapter(){
        public void windowClosing(WindowEvent e){
          &nbs ......

关于java内存泄漏的经典文章(一)

一 问题的提出
       Java的一个重要优点就是通过垃圾收集器(Garbage Collection,GC)自动管理内存的回收,程序员不需要通过调用函数来释放内存。因此,很多程序员认为Java不存在内存泄漏问题,或者认为即使 有内存泄漏也不是程序的责任,而是GC或JVM的问题。其实,这种想法是不正确的,因 ......

java调用存储过程无法取得返回参数

环境:数据库sql server2005,jdk1.6 ,myeclipse,驱动jdts1.2.2
执行以下代码,报错:
String querySQL = "{?=call p_sys_manager_csReport(?,?,?,?,?)}";
cstmt = conn.prepareCall(querySQL);
cstmt.registerOutParameter(1, java.sql.Types.INTEGER);
cstmt.setInt(2, modType);
cstmt.setInt(3, dptI ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号