OpenOffice使用JODConverter转换文档为PDF,报错:invalid officeHome: it doesn't contain soffice.bin:

configuration.setOfficeHome(); officehome 路径应为openoffice安装路径。我装的是4。所以配置路径应为:D:\\Program Files (x86)\\OpenOffice 4。

网上很多是配置成D:\\Program Files (x86)\\OpenOffice 4\\program。翻阅了源码一下,寻找soffice.bin时,自动添加program文件夹。

如果再配置成D:\\Program Files (x86)\\OpenOffice 4\\program,则它在验证是否有soffice.bin文件时。

实际路径为:D:\\Program Files (x86)\\OpenOffice 4\\program\\program\\soffice.bin。所以报错。

因此路径去掉program即可:D:\\Program Files (x86)\\OpenOffice 4\\


来源于:

https://bbs.csdn.net/topics/390826429

猜你喜欢

转载自blog.csdn.net/weixin_41888813/article/details/85331295
今日推荐