I verified rtf file - problematic is font definitions in RTF header:
Oryginal font definition:
{\fonttbl{\f0\fnil\fcharset1 Arial;}{\f1\fnil\fcharset238 Tahoma;}{\f2\fnil\fcharset1 Times New Roman;}{\f3\fnil\fcharset238 Arial;}{\f4\fnil\fcharset2 Wingdings;}}
Manual corrected RTF - works fine:
{\fonttbl{\f0\fnil\fcharset238 Arial;}{\f1\fnil\fcharset238 Tahoma;}{\f2\fnil\fcharset238 Times New Roman;}{\f3\fnil\fcharset238 Arial;}{\f4\fnil\fcharset2 Wingdings;}}
Attached complete example code with sample files and another screenshot from Word 2013.
Code:
public class AsposeWordsRtfToOdtProblemDemo {
static class HandleFontSubstitution implements IWarningCallback {
@Override
public void warning(WarningInfo info) {
System.out.println(info.getDescription());
}
}
public static void main(String[] args) {
try {
File rtfFile = new File("source.rtf");
System.out.println(rtfFile.getAbsolutePath());
HandleFontSubstitution callback = new HandleFontSubstitution();
LoadOptions lo = new LoadOptions();
lo.setWarningCallback(callback);
lo.setEncoding(Charset.forName("cp1250"));
lo.setLoadFormat(LoadFormat.RTF);
Document doc = new Document("source.rtf", lo);
OdtSaveOptions so = new OdtSaveOptions();
so.setWarningCallback(callback);
so.setSaveFormat(SaveFormat.ODT);
doc.save("result.odt", so);
} catch (Exception ex) {
Logger.getLogger(AsposeWordsRtfToOdtProblemDemo.class.getName()).log(Level.SEVERE, null, ex);
}
}
}