简体   繁体   English

是否有支持Microsoft Office和Open Office的Java库?

[英]Is there any Java library which supports both Microsoft office and Open Office?

As Apache POI supports Microsoft office and JExcelApi supports Open Office, is there any Java library which supports both Microsoft office and Open Office? 由于Apache POI支持Microsoft Office,而JExcelApi支持Open Office,是否有支持Microsoft Office和Open Office的Java库?

Note: In the pom.xml file we are using either POI and JExcel utilities in order to fetch/read data from the Excel sheet in Microsoft office and Open Office respectively. 注意:在pom.xml文件中,我们使用POI和JExcel实用程序,以便分别从Microsoft Office和Open Office中的Excel工作表中获取/读取数据。

So my question: Is there any library which supports both? 所以我的问题是:有没有支持两者的图书馆?

Aspose covers all of Microsofts formats, but it is not free and not open source. Aspose涵盖了所有的微软格式,但它不是免费的,也不是开源的。

Regarding open source Java API, you can find a review on each available java library here, 关于开源Java API,您可以在这里找到每个可用Java库的评论,

http://www.esupu.com/open-source-office-document-java-api-review/ http://www.esupu.com/open-source-office-document-java-api-review/

Apache UNO Java library supports all according to my knowledge and it's free and open source but it need a Open Office installation to process and it's documentation is heavy and not that much clear Apache UNO Java库根据我的知识支持所有,它是免费和开源的,但它需要一个Open Office安装来处理它的文档很重,不是很清楚

docx4j is a Java library for creating and manipulating Microsoft Open XML (Word docx, Powerpoint pptx, and Excel xlsx) files. docx4j是一个用于创建和操作Microsoft Open XML(Word docx,Powerpoint pptx和Excel xlsx)文件的Java库。

Docx4j Docx4j

There is probably no library that would support both formats. 可能没有可以支持这两种格式的库。 If you don't want to use a library (and write the needed code) for each format, you can try a workaround. 如果您不想为每种格式使用库(并编写所需的代码),可以尝试一种解决方法。

Use a converter to convert .xls to .odt (or the other way around), then use your favourite library to handle that one format. 使用转换器将.xls转换为.odt (或其他方式),然后使用您喜欢的库来处理这种格式。

Available converters I found via quick Googling, I'm sure you'll find more: 通过快速谷歌搜索找到的可用转换器,我相信你会找到更多:

Consider converting both formats to something more friendly, like a CSV (more CSV ) or XML. 考虑将两种格式转换为更友好的格式,如CSV (更多CSV )或XML。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM