I am trying to read data from a odt file (created with LibreOffice). The requirement is to get the xml that is binded to an XForm included in the document. I am currently using the odfdom-java library to read the file. So far I have managed to read the values of the form field by parsing the document with jdom, but what I actually want is to get the whole xml with the form data. Alternatively, I can load the file as
OdfTextDocument.loadDocument("C://myFile.odt");
.
Does anyone know how I can get the XForm xml from there?
Alternatively, would it help if I converted the odt file to pdf programmatically? Using pdfbox I have managed to get the acroform
PDDocument pdDoc = PDDocument.loadNonSeq( new File("C://myFile.odt"), null);
PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
PDAcroForm pdAcroForm = pdCatalog.getAcroForm();
but face the same problem afterwards (how to get the xml with the form data).