# wps2pdf **Repository Path**: hlyq/wps2pdf ## Basic Information - **Project Name**: wps2pdf - **Description**: No description available - **Primary Language**: Python - **License**: MulanPSL-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-11-11 - **Last Updated**: 2025-11-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # wps2pdf ----------- github源项目:https://github.com/sun-wming/wps2pdf/blob/main/Dockerfile WPS Linux [下载地址]https://zh-hant.wps.com/office/linux/ 离线包在阿里云盘中:wps-pdf wps-office_11.1.0.10920_amd64.deb(原始github中使用版本:https://wdl1.cache.wps.cn/wps/download/ep/Linux2019/10920/wps-office_11.1.0.10920_amd64.deb ) wps-office_11.1.0.11723.XA_amd64.deb(版本也可好使:https://zh-hant.wps.com/office/linux/) wps-office-11.1.0.11723.XA-1.x86_64.rpm(版本也可好使:https://zh-hant.wps.com/office/linux/) ### 1. 构建jdk基础镜像 ``` docker build --no-cache -f DockerfileJdk -t debian_jdk17:bullseye-slim . ``` ### 2. 构建基础镜像 ``` docker build --no-cache -f DockerfileBase -t debian_jdk17_wps:bullseye-slim . ``` ### 3. 构建业务镜像 ``` docker build --no-cache -f DockerfileApp -t debian_jdk17_wps_svc:bullseye-slim . ``` 构建业务镜像时,可能会出现异常: ``` 1.160 1.160 WARNING: apt does not have a stable CLI interface. Use with caution in scripts. 1.160 1.329 Get:1 http://mirrors.tuna.tsinghua.edu.cn/debian bullseye InRelease [75.1 kB] 1.446 Get:2 http://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security InRelease [27.2 kB] 1.486 Get:3 http://mirrors.tuna.tsinghua.edu.cn/debian bullseye-updates InRelease [44.0 kB] 1.799 Get:4 http://mirrors.tuna.tsinghua.edu.cn/debian bullseye/main amd64 Packages [8066 kB] 2.365 Get:5 http://mirrors.tuna.tsinghua.edu.cn/debian bullseye-updates/main amd64 Packages [18.8 kB] 4.850 Reading package lists... 6.088 E: Release file for http://mirrors.tuna.tsinghua.edu.cn/debian-security/dists/bullseye-security/InRelease is not valid yet (invalid for another 5h 38min 44s). Updates for this repository will not be applied. ------ DockerfileBase.txt:9 ``` 问题原因:可能是宿主机的时间与 python 仓库的时间(实际时间)不一致导致,同步本地时间即可 ### 4. 启动命令 ``` docker run -dit --name wps -v /root:/app -p 9000:9000 debian_jdk17_wps_svc:bullseye-slim ``` ### 5. 访问命令 ``` curl -X POST -F "file=@test.docx" -F "format=pdf" http://localhost:9000/convert --output result.pdf ``` ### 6. 当前Dockerfile文件已经修复,如果使用github源是项目中的方式,会出现Qt5缺失问题 查看 ``` whereis libQt5Core.so.5 ``` 解决执行命令,或者添加到Dockerfile文件中 ``` strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 ``` # 部署实际业务应用 注意,如果基于镜像 debian_jdk17_wps_svc 构建业务镜像,由于可能会被覆盖启动命令 ENTRYPOINT ,导致wps服务脚本不会启动 解决方法:可参考: ``` # 指定基础镜像,并且必须是第一条指令 FROM 10.49.105.10:8082/debian_jdk17_wps_svc:bullseye-slim ADD ./edi-admin/target/*.jar /app/ # 添加容器时区配置 ENV TZ=Asia/Shanghai # 添加jvm启动参数 ENV JAVA_OPTS="$JAVA_OPTS -Duser.timezone=GMT+08" #启动命令 #启动命令中直接执行两条命令,注意:如果第一个命令需要后台执行使用 & 符号,则第一二个命令之间就不能再使用 分号(;)进行分割,否则会报错 ENTRYPOINT ["bash", "-c", "nohup /entrypoint.sh > /home/app/edi-admin/wps.log 2>&1 & java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app/*.jar"] ``` # 说明 为什么要将 镜像:debian_jdk17_wps 与镜像:debian_jdk17_wps_svc 分开构建? 经过测试放在一起构建会失败,暂时不知道为什么 ## 使用问题 测试中发现,使用该基础镜像:debian:bullseye-slim 和 oracle的jdk-17.0.12_linux-x64_bin.tar.gz 构建出来的应用镜像在使用中会出现如下异常: ``` [2025-11-12 17:12:33.438] ERROR --- [io-38899-exec-9] c.s.e.b.m.s.a.s.ApiEncryptServiceSmImpl : SecurityException: JCE cannot authenticate the provider BC cn.hutool.crypto.CryptoException: SecurityException: JCE cannot authenticate the provider BC at cn.hutool.crypto.SecureUtil.createCipher(SecureUtil.java:1037) at cn.hutool.crypto.CipherWrapper.(CipherWrapper.java:39) at cn.hutool.crypto.symmetric.SymmetricCrypto.init(SymmetricCrypto.java:150) at cn.hutool.crypto.symmetric.SymmetricCrypto.(SymmetricCrypto.java:127) at cn.hutool.crypto.symmetric.SymmetricCrypto.(SymmetricCrypto.java:115) at cn.hutool.crypto.symmetric.SymmetricCrypto.(SymmetricCrypto.java:104) ``` 建议实际业务中根据实际情况安装缺失依赖或者更换JDk或者更换其他linux基础镜像 ## 处理 测试中发现,使用openJdk 就没有上面问题,测试使用的是:bisheng-jre-17.0.16-b11-linux-x64.tar.gz