openoffice版本:OpenOffice_4.1.5_Linux_x86-64_install-rpm_zh-CN
linux版本:Red Hat Enterprise Linux 7.2
下载openoffice:https://www.openoffice.org/download/
a) 解压openoffice文件
tar -xvzfApache_OpenOffice_4.1.5_Linux_x86-64_install-rpm_zh-CN.tar.gz
b) 安装openoffice
cd RPMS
rpm -ivh *.rpm
cd desktop-integration
rpm -ivh openoffice4.1.5-redhat-menus-4.1.5-9789.noarch.rpm
c) 准备openoffice需要的字体(跳过此步,会导致word转pdf中文乱码,做合同比对demo时就因为这个原因识别结果有误!在window上有对应字体文件,所以正常。)
将字体拷贝到linux系统下 /usr/share/fonts(window下字体在:C:\Windows\Fonts)
执行以下步骤:
mkfontscale
mkfontdir
fc-cache
d) 启动openoffice服务
cd /opt/openoffice4/program(openoffice默认安装目录)
soffice --headless--accept="socket,host=127.0.0.1,port=8100;urp;" --nofirststartwizard&
e) 查看openoffice服务是否启动
netstat -nlp | grep 8100
ps -ef |grep 8100
f) 停止openoffice服务
kill PID
g) 卸载openoffice
rpm -e `rpm -qa |grep openoffice` `rpm -qa |grep ooobasis`