Contents | Start | End | Previous: KB0345: Why are some styles in other documents not listed in the Formatting Palette? | Next: KB0347: Why are there problems reading my Epub in Apple Books?


KB0346: How do I fix an error when launching my OpenDocument (ODT) file?

Occasionally, you may find that although Jutoh reports no errors when compiling an OpenDocument file, when clicking Launch, LibreOffice/OpenOffice or other word processor reports an error, for example:

Read-Error.
Format error discovered in the file in sub-document content.xml at 4097,33(row,col).

This is usually caused by an invalid character that was somehow pasted or imported into your project. To identify where the problem is in your project, examine the ODT file using the menu command Book | Examine (F6). This shows the constituent files of the ODT file. Ensure Tidy XML is switched off. Click on the file reported in the error message (such as content.xml) and then click Goto. Enter the line number and click OK.

The problem may be immediately obvious, such as some strange-looking characters. Observe the context of the error, e.g. some text, and go to that point in your project - a quick method is to copy and paste some text into the Find and Replace dialog and search the project.

Now you can try deleting text that may have caused the error. Invalid characters might not show, or show as spaces, so you may need to experiment with deleting portions of text and compiling again. Don't forget to close the word processor error dialog (in e.g. LibreOffice) before compiling and launching again, or Jutoh won't be able to write to the ODT file.

Very rarely, the document error is caused by bad code generated by Jutoh. If it looks as though this is the case, please email your Jutoh project file to us at jutoh@anthemion.co.uk so we can troubleshoot it.

Narrowing down the problem

If you can't immediately see where the problem is even when using the Examine command, another approach is to keep disabling content and compiling again until the problem goes away. Then you can narrow down the problem to certain content.

You can exclude whole documents from the compile by editing the documents' properties with Documents | Document Properties (Shift+Alt+Enter) and clearing the ODT format. Use the left and arrow buttons in the document properties dialog to quickly flip through the properties for multiple documents. If you have narrowed it down to a particular document, then you can narrow it down further either by deleting content (if you are working on a copy of the project!) or by using a conditional content tag.

To use a conditional content tag, select some content, go to the Objects tab in the Inspector, and double-click on condition. Enter a tag such as "none".

Now edit your configuration and set the option Exclude content matching tags to "none".

When you compile, the content within the tag start and end objects will be excluded. You can delete the tag by clicking on the tag and then on Delete. You can cut and paste the start and end objects to exclude more or less content.

The quickest way to narrow down a problem is using the 'binary chop' method:

  1. Remove half the project and compile. If the problem goes away, it's in the half you removed. If the problem doesn't go away, it's in the half you didn't remove.

  2. Take the half you identified above as containing the problem and remove half of that.

  3. Go to (1) until you've narrowed it down sufficiently to correct the problem or report it to us.


Contents | Start | End | Previous: KB0345: Why are some styles in other documents not listed in the Formatting Palette? | Next: KB0347: Why are there problems reading my Epub in Apple Books?