Question

In my Java application I have to read in data from an .odt document. Can somebody tell me how to get a reference to the first table in such a document? I wanted to use the Apache odf toolkit, but there I only found a method to get the table by name:

 TextDocument doc = TextDocument.loadDocument("/Users/me/Desktop/someFile.odt");
 Table t = doc.getTableByName("0");

My document contains one large table I need to parse, but I don't know its name.. Is there a way to find it out? Or an other way to get the table?

Thanks in advance!

Was it helpful?

Solution

You can use doc.getTableList() to get a list of all the tables in the document.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top