POI读取word只能读取内容不能读取格式
tm-extractors-0.4.jar
import java.io.FileInputStream; import org.textmining.text.extraction.WordExtractor; public class Test { public static void main(String[] args) { try { FileInputStream in = new FileInputStream("d:\\a.doc"); WordExtractor extractor = new WordExtractor(); System.out.println(in.available()); String str = extractor.extractText(in); System.out.println(str); } catch (Exception e) { e.printStackTrace(); } } }
原文地址:http://www.cnblogs.com/gdds/p/3840452.html