I had problem with 20 pages long ODT file (text and pictures). Problem was: when I tryed to open it,
I got message "Error reading file" under OO 2.3.1 (both linux and windows versions).
It took some hours to figure out, how to fix it, so I want to share my solution with other OO users
First, let's call our nonopening ODT file as "bad.odt".
- make backup FIRST -> "$ cp bad.odt bad_original.odt"
- make new directory-> "$ mkdir repair"
- copy bad.odt to repair directorty "$ cp bad.odt repair"
- change default directory to repair -> "$ cd repair"
- unzip bad.odt -> "$ unzip bad.odt"
- after unzipping you get bunch of files and directory's under repair , find content.xml and open it whit your favorite text editor -> "$ kate content.xml"
- use "find" function to find out, if you have XML tag "<office:automatic-styles>" (somewhere at the beginning of document) and XML tag "</office:automatic-styles>" (somewhere, middle of document). If you have, then delete them and all data between them. Be sure, that you don't delete more or less!
- save content.xml (keep original name and place!)
- zip extracted data back to one ODT document -> "$ zip -r ./bad_repaired.odt ./*"
- try to open repaired document -> "$ ooffice ./bad_repaired.odt"
Well, I got back my text and pictures, but the price was - no styles (font size; bold; heading etc...)
If your document do not opening and you get message like "Format error discovered in the file in sub-document context.xml at ...",
then you broke XML structure and must go back to "STEP ONE" ant try to be more careful with deleting things.
PS1: if you get CRC errors, when unzipping ODT, then my solution probable can't help you
PS2: I tried also insert "bad.odt" into new document, but still got "Error reading file" message
PS3: and " META-INF/manifest.xml file " trick did not help also
If someone what to investigate my broken ODT file, then it can be downloaded from -> http://adsl213.pointclark.net/Eksam.odt