Reputation: 3468
By "not depend on automation", I mean that it should not require a Microsoft Office installation to work; let alone interact with a live instance of a Microsoft Office component. One such library is Aspose.Total for Java. Are there any more out there?
Another solution I'm considering is to use OpenOffice.org. However, I'm not sure if I'm going to run into the same problems as with Microsoft Office as detailed here.
Upvotes: 3
Views: 6288
Reputation: 5061
There are two further answers for this question. Depending on your application.
can borrow from the OpenOffice library code that deals with opening and saving MS Office files. (See: http://www.artofsolving.com/opensource/jodconverter or jOpenDocument )
You might just use OpenOffice itself by scripting or automating that.
I faced this question a while back with a Ruby app and because I was in control of the source document, I got the originator to save things as HTML format and used Tidy to filter the junk. Another option it to find a tool to convert the Office files to RTF which is more generic.
Another to consider ...
You may find spreadsheets BIG unless you use OpenOffice or MS Office because you need to have a fancy shamancy virtual sparse matrix to do what they do well.
Upvotes: 0
Reputation: 72284
One designed specifically to with with the newer XML formats is docx4j: http://dev.plutext.org/trac/docx4j
Upvotes: 1
Reputation: 489
For Office Documents: http://poi.apache.org/
I have not tried this myself, but Apache usually deliver good libraries
For just Excel: JExcel API for Java
I use this for one application, and it works quite well. May use a fair bit of RAM for larger documents.
Upvotes: 3