使用POI抽取Word内容

xiaoxiao2023-11-21  16

使用POI3.5抽取Word内容只需要一句

 

/** * 使用<a href="http://poi.apache.org/">POI</a>抽取MS office 2003 word格式的文件内容 * @param file * MS Word2003 格式的{@link File}实例 * @return 文件内容的{@link String} * @throws IOException * @throws FileNotFoundException */ public String getContents(File file) throws FileNotFoundException, IOException { WordExtractor wordExtractor = new WordExtractor(new FileInputStream( file)); return wordExtractor.getTextFromPieces(); }   相关资源:POI生成word文档
转载请注明原文地址: https://www.6miu.com/read-5011341.html

最新回复(0)