unoconv (Universal office convert) is a very special tool when it comes to converting Word files to PDF.
Installation
0. Verify if python is installing
if you don't have python installed so:
## look for the latest version
sudo dnf install python3.8
## set aliases
alternatives --set python /usr/bin/python3
## more information
man unversioned-python
1. install libreOffice
important! download the latest stable version compatible with unoconv from http://download.documentfoundation.org/libreoffice/stable
## download libreoffice
wget http://download.documentfoundation.org/libreoffice/stable/6.0.4/deb/x86_64/LibreOffice_6.0.4_Linux_x86-64_deb.tar.gz
## unzip
tar -xvf LibreOffice_6.4.7_Linux_x86-64_rpm.tar.gz
## install RPM
cd LibreOffice_6.4.7_Linux_x86-64_rpm/RPMS
dnf install *.rpm
2. install unoconv
git clone https://github.com/dagwieers/unoconv.git
# this
cp unoconv/unoconv /usr/bin
# or
ln -s unoconv/unoconv /usr/bin/unoconv
*3. configure service for apache *
first, edit or create this file:
vi /etc/systemd/system/unoconv.service
second, paste the following text, but it's important to replace UNO_PATH with the libreOffice installation path.
[Unit]
Description=Unoconv listener for document conversions
Documentation=https://github.com/dagwieers/unoconv
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=simple
Environment="UNO_PATH=/usr/lib64/libreoffice/program"
ExecStart=/usr/bin/unoconv --listener
[Install]
WantedBy=multi-user.target
now you can start unoconv service
systemctl enable unoconv.service
systemctl start unoconv.service
Top comments (0)