Ryan's Java world!

something about Java and opensource!

BlogJava 首页 新随笔 联系 聚合 管理
  51 Posts :: 25 Stories :: 59 Comments :: 0 Trackbacks
用如下的方法

   WordDocument wd = new WordDocument(is);
  StringWriter docTextWriter = new StringWriter();
  wd.writeAllText(new PrintWriter(docTextWriter));
  docTextWriter.close();
  bodyText = docTextWriter.toString();  
    // bodyText = new WordExtractor().extractText(is);
  System.out.println(bodyText);



抽取不出所有的文件, 好像有字数限制, 只能抽取前面部分字符. 是不是bug啊,



使用过poi的, 有没有遇到这种问题啊, 有没有好的办法呢, 路过的给点建议. 谢谢
posted on 2006-08-25 18:05 冰雨 阅读(1562) 评论(4)  编辑  收藏 所属分类: Opensource

Feedback

# re: 关于apache poi 抽取word文本的问题, 2006-08-25 20:36 dudu
这样的文章不合适发布在BlogJava首页!  回复  更多评论
  

# re: 关于apache poi 抽取word文本的问题, 2006-08-25 21:13 冰雨
哦 知道了,  回复  更多评论
  

# re: 关于apache poi 抽取word文本的问题, 2006-11-06 18:33 软件搜索
FileInputStream in = new FileInputStream ("c:\\a.doc");
WordExtractor extractor = new WordExtractor();
String str = extractor.extractText(in);
System.out.println("the result length is"+str.length());
System.out.println("the result is"+str);


试试这个  回复  更多评论
  

# re: 关于apache poi 抽取word文本的问题, 2006-11-10 11:03 li
我也碰到一样的问题  回复  更多评论
  


只有注册用户登录后才能发表评论。


网站导航:
 

JSF中文技术文摘