使用Java的文档提取嵌入文件 [英] Extract embedded files from doc using java

查看:675
本文介绍了使用Java的文档提取嵌入文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的POI库来处理MS文件。要提取的docx嵌入OLE对象,XLSX和PPTX,我使用的方法:的PackagePart PP = src.getAllEmbedds()但对于MS文件,如DOC,XLS旧格式和PPT,不存在这样的方法。所以,我现在用的提取: POITextExtractor [] = embeddedExtractors
                ExtractorFactory.getEmbededDocsTextExtractors(oleTextExtractor);
但这只能提取文本而不是整个文件。
谁能帮我提取DOC,PPT和XLS文件?

I am using the poi library to deal with the MS files. To extract the embedded ole object for docx, xlsx and pptx, I use method:PackagePart pp = src.getAllEmbedds() But for the old format of MS files like doc, xls and ppt, there is no such method. So I am using the extractor: POITextExtractor[] embeddedExtractors = ExtractorFactory.getEmbededDocsTextExtractors(oleTextExtractor); But this can only extract the text not the whole file. Can anyone help me with extracting doc, ppt and xls files?

推荐答案

OLE2 文件包括大多数的的Microsoft Office 的文件,如 XLS 商务部 PPT 以及 MFC 序列化API基于文件格式。 办公室的OpenXML格式是基于新标准的中找到的XML 文件格式的的Microsoft Office 2007 2008 。这包括 XLSX DOCX PPTX

OLE2 files include most Microsoft Office files such as XLS, DOC, and PPT as well as MFC serialization API based file formats. Office OpenXML Format is the new standards based XML file format found in Microsoft Office 2007 and 2008. This includes XLSX, DOCX and PPTX.

对于每个微软Office 应用程序存在,试图提供一个通用的高水平的的Java API既 OLE2 和<强的组件模块> OOXML 文档格式。

For each MS Office application there exists a component module that attempts to provide a common high level Java api to both OLE2 and OOXML document formats.

请参阅

这篇关于使用Java的文档提取嵌入文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆