zoukankan      html  css  js  c++  java
  • debian 安装libreoffice6.1 转换pdf

    这个东西能转,但效率不高,我已经用专门的服务器docker,速度很快,直接用curl就能返回

    但这里还是记录一下直接用命令调用吧,毕竟有的老的地方这么用

    && cd /usr/local/
    && curl -O https://download.java.net/java/GA/jdk11/13/GPL/openjdk-11.0.1_linux-x64_bin.tar.gz
    && tar zxvf openjdk-11.0.1_linux-x64_bin.tar.gz
    && cd jdk-11.0.1
    && echo "export JAVA_HOME=/usr/local/jdk-11.0.1" >> /etc/profile
    && echo "export CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar" >> /etc/profile
    && echo "export PATH=$PATH:$JAVA_HOME/bin" >> /etc/profile
    && update-alternatives --install /usr/bin/java java /usr/local/jdk-11.0.1/bin/java 1100
    && update-alternatives --install /usr/bin/javac javac /usr/local/jdk-11.0.1/bin/javac 300
    && update-alternatives --config java
    && update-alternatives --config javac
    && apt-get remove -y --purge libreoffice* libexttextcat-data* && apt-get -y autoremove
    && mkdir /usr/libreoffice/
    && cd /usr/libreoffice/
    && curl -L -o ./LibreOffice_6.1.4_Linux_x86-64_deb.tar.gz http://download.documentfoundation.org/libreoffice/stable/6.1.4/deb/x86_64/LibreOffice_6.1.4_Linux_x86-64_deb.tar.gz
    && tar -xvf LibreOffice_6.1.4_Linux_x86-64_deb.tar.gz
    && rm -f LibreOffice_6.1.4_Linux_x86-64_deb.tar.gz
    && cd /usr/libreoffice/LibreOffice_6.1.4.2_Linux_x86-64_deb/DEBS
    && dpkg -i *.deb
    && cd /usr/libreoffice/
    && curl -L -o ./LibreOffice_6.1.4_sdk.tar.gz http://download.documentfoundation.org/libreoffice/stable/6.1.4/deb/x86_64/LibreOffice_6.1.4_Linux_x86-64_deb_sdk.tar.gz
    && tar xfz LibreOffice_6.1.4_sdk.tar.gz
    && rm -r LibreOffice_6.1.4_sdk.tar.gz
    && cd /usr/libreoffice/LibreOffice_6.1.4.2_Linux_x86-64_deb_sdk/DEBS
    && dpkg -i *.deb
    && cd /usr/libreoffice/
    && curl -L -o ./LibreOffice_6.1.4_langpack_zh-CN.tar.gz http://download.documentfoundation.org/libreoffice/stable/6.1.4/deb/x86_64/LibreOffice_6.1.4_Linux_x86-64_deb_langpack_zh-CN.tar.gz
    && tar xfz LibreOffice_6.1.4_langpack_zh-CN.tar.gz
    && rm -r LibreOffice_6.1.4_langpack_zh-CN.tar.gz
    && cd /usr/libreoffice/LibreOffice_6.1.4.2_Linux_x86-64_deb_langpack_zh-CN/DEBS
    && dpkg -i *.deb
    && cd /usr/libreoffice/

    最后执行转换

    libreoffice6.1 --invisible --convert-to pdf:writer_pdf_Export --outdir  "/root/" "pad_interface.docx"

  • 相关阅读:
    LeetCode 382. Linked List Random Node
    LeetCode 398. Random Pick Index
    LeetCode 1002. Find Common Characters
    LeetCode 498. Diagonal Traverse
    LeetCode 825. Friends Of Appropriate Ages
    LeetCode 824. Goat Latin
    LeetCode 896. Monotonic Array
    LeetCode 987. Vertical Order Traversal of a Binary Tree
    LeetCode 689. Maximum Sum of 3 Non-Overlapping Subarrays
    LeetCode 636. Exclusive Time of Functions
  • 原文地址:https://www.cnblogs.com/si812cn/p/10271847.html
Copyright © 2011-2022 走看看