zoukankan      html  css  js  c++  java
  • SpringBoot+OpenOffice Office文档在线预览

    将office文件转化成pdf,nginx代理进行预览
    1.安装OpenOffice,并打开服务。
    windows:进入cmd:
    cd C:Program Files (x86)OpenOffice 4program
    soffice -headless -accept="socket,host=IP,port=8100;urp;" -nofirststar2.pom中导入jar包<!-- https://mvnrepository.com/artifact/org.jodconverter/jodconverter-local -->
    <dependency>
    <groupId>org.jodconverter</groupId>
    <artifactId>jodconverter-local</artifactId>
    <version>4.2.2</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.jodconverter/jodconverter-spring-boot-starter -->
    <dependency>
    <groupId>org.jodconverter</groupId>
    <artifactId>jodconverter-spring-boot-starter</artifactId>
    <version>4.2.2</version>
    </dependency>

    3.SpringBoot配置文件
    jodconverter.local.enabled=true
    jodconverter.local.port-numbers=8100

    4.编码
    import org.jodconverter.DocumentConverter;
    @Autowired
    private DocumentConverter documentConverter;
    documentConverter.convert(oldFile).to(pdfFile).execute();
     
  • 相关阅读:
    linux ss 命令
    linux netstat 命令
    linux firewalld 命令
    linux sshd 服务
    linux rysnc 命令(远程复制)
    linux scp 命令
    linux ifconfig
    linux /var/log 日志文件
    linux systemctrl 命令
    linux 创建新用户并设置管理员权限
  • 原文地址:https://www.cnblogs.com/god-monk/p/11321728.html
Copyright © 2011-2022 走看看