Currently we use OpenOffice to grab bookmarks in a template file document and replace them with content from our DB via Java. The lines of code that actually save the file look like this...
XStorable storable = UnoRuntime.queryInterface(XStorable.class, document);
// Save as Word 97 Document
PropertyValue[] properties = new PropertyValue[1];
PropertyValue property = new PropertyValue();
property.Name = "FilterName";
property.Value = FORMAT_WORD_97;
properties[0] = property;
storable.storeAsURL(saveFileURL, properties);
We want to directly write the file to the servlet response outputstream, does anybody know of a way to directly get the document as a byte array or inputstream via OpenOffice's UNO api in Java?