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(); } } }
通过POI读取word文件
时间: 2024-11-29 06:06:31