使用 soffice 将 doc 转换为 docx 不起作用

convert doc to docx using soffice not working

我正在尝试使用以下命令将文档转换为 docx:

soffice --headless --convert-to docx test.doc

我正在使用 centos7,从 openoffice 到安装所有东西

yum install openoffice

我在.doc文件的当前目录下。

我遇到与过滤器相关的错误(我搜索了这些过滤器,但没有找到可以解决我问题的过滤器):

Error: no export filter for teste.docx found, aborting.
Error: no export filter

每次我放一些过滤器时,它都会给我另一个错误:

Error: Please verify input parameters... (SfxBaseModel::impl_store <file:///path/test.txt> failed: 0x81a)

我安装了过滤器(来自 soffice 的过滤器示例)但仍然无法正常工作

soffice --headless --convert-to html:"txt:Text (encoded):UTF8"  --outdir /home/user/Downloads  /home/user/Downloads/test.doc 

我发现它不起作用的原因。我卸载了 oppenoffice 和 libreoffice,然后再放一个。

yum remove openoffice* libreoffice*
yum install libreoffice*

可能它缺少某些库或某些依赖项存在冲突。

现在一切正常。

soffice --headless --convert-to docx  teste.doc