异常:java.lang.IllegalArgumentException: The document is really a OOXML file 1、场景 项目中需要使用到读取 word 文档中的内容,使用的工具是 apache poi 来实现 word 、ppt 、excel 等文件的读取。在开发过程中,读取文件的过程中,出现了异常:java.lang.IllegalArgumentException: The document is really a OOX...
Caused by: org.apache.poi.openxml4j.exceptions.NotOfficeXmlFileException: No valid entries or contents found,thisis not a valid OOXML (Office Open XML) file 从字面意思可以知道:读取的不是一份有效的文件。先查看测试用的word文档原件: 编译后的word文档打开有损坏提示,打开以后文件乱码: ...
String filePath = fileHone.getParentFile().getAbsolutePath() + File.separator + "export" + File.separator; String fileName = "演示模板.docx"; FileUtil.mkdirs(filePath); File file = new File(filePath + fileName); outputStream = new FileOutputStream(file); document.write(outputStream); o...
int isBold = 0; int superId = 0; try { String url = filePath+fileName; InputStream is = new FileInputStream(url); if(url.endsWith(".DOCX") || url.endsWith(".docx")){ XWPFDocument document = new XWPFDocument(is); List<XWPFParagraph> paragraphList = document.getParagraphs(); for (...
document, you have to rely on third party library to do your job. Fortunately there are couple of open source library exists to read and write Microsoft Office XLS and XLSXfile format, Apache POI is the best one. It is widely used, has strong community support and it is feature rich. ...
Apache Axiom is a StAX-based, XML Infoset compliant object model which supports on-demand building of the object tree. It supports a novel "pull-through" model which allows one to turn off the tree building and directly access the underlying pull event stream. It also has built in support ...
packr - Packs JARs, assets and the JVM for native distribution on Windows, Linux and Mac OS X. really-executable-jars-maven-plugin - Maven plugin for making self-executing JARs. Document Processing Libraries that assist with processing office documentformats. Apache POI - Supports OOXML (XLSX...
packr - Packs JARs, assets and the JVM for native distribution on Windows, Linux and macOS. really-executable-jars-maven-plugin - Maven plugin for making self-executing JARs. Document Processing Libraries that assist with processing office document formats. Apache POI - Supports OOXML (XLSX, DOCX...
Orika- Orika is a Java Bean mapping framework that recursively copies (among other capabilities) data from one object to another. Selma- Stupid Simple Statically Linked Mapper. Selma is an Annotation Processor Based bean mapper. Build Tools which handle the build cycle and dependencies of an appli...