自动安装

1
2
3
4
5
6
7
8
9
10
11
apt-get install libreoffice -y

apt-get install libreoffice-l10n-zh-cn libreoffice-help-zh-cn -y

cd /usr/share/fonts && \
wget https://mirrors.tuna.tsinghua.edu.cn/adobe-fonts/source-han-sans/SubsetOTF/SourceHanSansCN.zip && \
wget https://mirrors.tuna.tsinghua.edu.cn/adobe-fonts/source-han-serif/SubsetOTF/SourceHanSerifCN.zip && \
unzip SourceHanSansCN.zip && \
unzip SourceHanSerifCN.zip && \
rm -rf SourceHanSerifCN.zip && \
rm -rf SourceHanSerifCN.zip

转换命令

1
soffice --headless --invisible --convert-to pdf:writer_pdf_Export ./test.pptx --outdir ./

手动安装

1
2
3
4
5
6
7
apt install -y openjdk-8-jdk libxinerama1 libcairo2 libcups2 libsm6

wget https://mirrors.cloud.tencent.com/libreoffice/libreoffice/stable/7.1.0/deb/x86_64/LibreOffice_7.1.0_Linux_x86-64_deb.tar.gz

tar -zxvf LibreOffice_7.1.0_Linux_x86-64_deb.tar.gz

dpkg -i ./LibreOffice_7.1.0_Linux_x86_deb/DEBS/*.deb

注意

  • 自动安装后命令为soffice
  • 手动安装后命令为libreoffice7.1

参考