使用 Apache Poi 将 doc 文件转换为 html [英] Convert doc file to html using Apache Poi

查看:34
本文介绍了使用 Apache Poi 将 doc 文件转换为 html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个 android 应用程序,我需要在其中使用 Apache Poi 将 MS Office 文件转换为 HTML.到目前为止,我可以使用以下项目源将 .xlsx 转换为 htm-

I am working on an android application in which i need to convert MS office files to HTML using Apache Poi. Till now i am able to convert .xlsx to htm using the following project Source-

http://display-msoffice-docs-android-with-apache-poi.googlecode.com/svn/trunk/TestOfficeAndroid/

我可以看到org.apache.poi.hwpf.converter包中有一个WordToHtmlConverter类,它可以在其主要方法中将.doc文件转换为main() 方法以输入文件路径和输出文件路径为参数.但是当我调用 WordToHtmlConverter 的 main 方法时,它给出了 java.rmi.unexpectedexception 的 classnotfound 异常异常.android 没有 java.rmi.unexpectedexception 类.我怎样才能克服这个问题.任何帮助或指导将不胜感激.

i can see that there is a WordToHtmlConverter class in org.apache.poi.hwpf.converter package which can convert .doc file in its main method as its main() method takes the input file path and output file path as argument. But when i invoke the main method of WordToHtmlConverter, it gives classnotfound exception exception for java.rmi.unexpectedexception. There is no java.rmi.unexpectedexception class for android. How can i overcome this problem. Any help or guidance will be appreciated.

推荐答案

你试过 Docx4j?我不知道这是否适合您,因为我才刚刚开始使用它.(当我在 Stackoverflow 上查看是否有人使用它来创建 HTML5 时,我遇到了您的问题,我认为这应该很容易做到)

Have you tried Docx4j? I don't know if it's the answer for you, because I've only just started working with it. (I came across your question as I was looking on Stackoverflow to see if anyone had been using it to create HTML5, which I think should be fairly easy to do)

这篇关于使用 Apache Poi 将 doc 文件转换为 html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆