JODConvertor通过网络协议调用OpenOffice / LibreOffice . 因此,它可以“在OpenOffice中执行任何操作” . 这包括转换格式 . 但它只能像您运行的任何OpenOffice版本一样出色 . 我的一个文档中有一些艺术,并没有像我希望的那样转换它们 .
根据v3的谷歌代码网站,不再支持JODConvertor .
要让JOD完成这项工作,你需要做一些事情
private static void transformBinaryWordDocToDocX(File in, File out)
{
OfficeDocumentConverter converter = new OfficeDocumentConverter(officeManager);
DocumentFormat docx = converter.getFormatRegistry().getFormatByExtension("docx");
docx.setStoreProperties(DocumentFamily.TEXT,
Collections.singletonMap("FilterName", "MS Word 2007 XML"));
converter.convert(in, out, docx);
}
private static void transformBinaryWordDocToW2003Xml(File in, File out)
{
OfficeDocumentConverter converter = new OfficeDocumentConverter(officeManager);;
DocumentFormat w2003xml = ne