Corrupted .docx file creation when text areas

Issue #323 resolved
Former user created an issue

Original issue 323 created by aurelien.tomass... on 2013-04-02T09:47:04.000Z:

  1. I created a word document with a text area, or with an object containing a text
  2. I open the file thanks to okapi, and just write it to an other file with the corresponding filter
  3. The generated file is corrupted and can't be open with word. When i open the file document.xml inside the docx, I can see the "</w:txbxContent>" and "</wps:txbx>" are closed at the beggining of the document, and open at the end. (cf. attachments : ".._out_auto.docx" is the generated one)

I am using okapi v0.19 on windows 64bits.

The corresponding code is:

OpenXMLFilter filter = new OpenXMLFilter();
filter.open(new RawDocument(uri, "UTF-8", LocaleId.fromString(src_lang)), false,false);
IFilterWriter writer = filter.createFilterWriter();
writer.setOptions(LocaleId.fromString(tgt_lang), "iso-8859-1");
writer.setOutput(ouput);

while ( filter!=null && filter.hasNext() ) {
Event event = filter.next();
writer.handleEvent(event);
}
filter.close();
writer.close();

Comments (2)

  1. Log in to comment