How to Extract docx (Word 2007 above) using Apache POI

后端 未结 3 1579
失恋的感觉
失恋的感觉 2021-01-06 05:06

Hai, i\'m using Apache POI 3.6 I\'ve already created some code..

XWPFDocument doc = new XWPFDocument(new FileInputStream(file));
         wordxExtractor = ne         


        
相关标签:
3条回答
  • 2021-01-06 05:25

    It looks like you don't have all of the dependencies on your classpath.

    If you look at http://poi.apache.org/overview.html you'll see that dom4j is a required library when working with the OOXML files. From the exception you got, it seems that you don't have it... If you look in the POI binary download, you should find it in the ooxml-libs subdirectory.

    0 讨论(0)
  • 2021-01-06 05:36

    You could try docx4j instead; see http://dev.plutext.org/svn/docx4j/trunk/docx4j/src/main/java/org/docx4j/TextUtils.java

    0 讨论(0)
  • 2021-01-06 05:40

    You need to Add dom4j Library to your claspath or your project libraries

    0 讨论(0)
提交回复
热议问题