Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
461564a615 | ||
| b0082a57c7 | |||
| 62d62811fc | |||
| 2aadb288c0 | |||
| 268769c02c | |||
| 837028762b | |||
| 7f1c9af201 | |||
| 434a751575 |
@@ -11,7 +11,7 @@
|
||||
+ [docto-document-server](document-server/docto-document-server)下使用poi-tl处理word文件,使用docto调用`Microsoft Office`来转换格式,`java -jar xxx.jar`启动
|
||||
+ 仅能运行在Windows,兼容性最好,比较慢
|
||||
|
||||
+ [document-fonts](document-fonts)为linux下需要安装的中文字体
|
||||
+ [document-docker/fonts](document-docker/fonts)为linux下需要安装的中文字体
|
||||
|
||||
---
|
||||
|
||||
@@ -98,10 +98,6 @@ services:
|
||||
- GRAMER_CUSTOMIZE_LIST="%"
|
||||
- GRAMER_CUSTOMIZE_LIST_STRING_DELIMITING=","
|
||||
ports:
|
||||
# 用于通过http访问libreoffice
|
||||
- 3000:3000
|
||||
# 用于通过https访问libreoffice
|
||||
- 3001:3001
|
||||
# 文书转换服务端口,用于document-api远程调用document-server
|
||||
- 9004:9004
|
||||
volumes:
|
||||
|
||||
@@ -44,7 +44,10 @@ COPY app/document-server-*.jar /app/application.jar
|
||||
COPY app/application.yml /app/application.yml
|
||||
|
||||
# 拷贝字体文件并刷新字体缓存
|
||||
COPY fonts /usr/share/fonts/truetype
|
||||
COPY fonts/truetype /usr/share/fonts/truetype
|
||||
COPY fonts/cesi /usr/share/fonts/cesi
|
||||
COPY fonts/gb /usr/share/fonts/gb
|
||||
COPY fonts/wps-office /usr/share/fonts/wps-office
|
||||
RUN fc-cache -fv
|
||||
|
||||
# 入口
|
||||
|
||||
@@ -18,16 +18,16 @@ cp ../document-server/jodconverter-document-server/target/application.yml app/
|
||||
|
||||
#amd64
|
||||
echo 开始构建amd64镜像...
|
||||
docker buildx build --platform linux/amd64 -t document-server:1.0 ./
|
||||
docker buildx build --platform linux/amd64 -t yhl452493373/document-server:1.0 ./
|
||||
rm -rf document-server-1.0.tar.gz
|
||||
docker save document-server:1.0 | gzip > document-server-1.0.tar.gz
|
||||
docker save yhl452493373/document-server:1.0 | gzip > document-server-1.0.tar.gz
|
||||
echo amd64镜像构建成功.
|
||||
|
||||
#arm64
|
||||
echo 开始构建arm64镜像...
|
||||
docker buildx build --platform linux/arm64 -t document-server:1.0.arm64 ./
|
||||
docker buildx build --platform linux/arm64 -t yhl452493373/document-server:1.0.arm64 ./
|
||||
rm -rf document-server-1.0.arm64.tar.gz
|
||||
docker save document-server:1.0.arm64 | gzip > document-server-1.0.arm64.tar.gz
|
||||
docker save yhl452493373/document-server:1.0.arm64 | gzip > document-server-1.0.arm64.tar.gz
|
||||
echo arm64镜像构建成功.
|
||||
|
||||
# 清理临时文件
|
||||
|
||||
BIN
document-docker/fonts/cesi/CESI_FS_GB13000.TTF
Normal file
BIN
document-docker/fonts/cesi/CESI_FS_GB13000.TTF
Normal file
Binary file not shown.
BIN
document-docker/fonts/cesi/CESI_FS_GB18030.TTF
Normal file
BIN
document-docker/fonts/cesi/CESI_FS_GB18030.TTF
Normal file
Binary file not shown.
BIN
document-docker/fonts/cesi/CESI_FS_GB2312.TTF
Normal file
BIN
document-docker/fonts/cesi/CESI_FS_GB2312.TTF
Normal file
Binary file not shown.
BIN
document-docker/fonts/cesi/CESI_HT_GB13000.TTF
Normal file
BIN
document-docker/fonts/cesi/CESI_HT_GB13000.TTF
Normal file
Binary file not shown.
BIN
document-docker/fonts/cesi/CESI_HT_GB18030.TTF
Normal file
BIN
document-docker/fonts/cesi/CESI_HT_GB18030.TTF
Normal file
Binary file not shown.
BIN
document-docker/fonts/cesi/CESI_HT_GB2312.TTF
Normal file
BIN
document-docker/fonts/cesi/CESI_HT_GB2312.TTF
Normal file
Binary file not shown.
BIN
document-docker/fonts/cesi/CESI_KT_GB13000.TTF
Normal file
BIN
document-docker/fonts/cesi/CESI_KT_GB13000.TTF
Normal file
Binary file not shown.
BIN
document-docker/fonts/cesi/CESI_KT_GB18030.TTF
Normal file
BIN
document-docker/fonts/cesi/CESI_KT_GB18030.TTF
Normal file
Binary file not shown.
BIN
document-docker/fonts/cesi/CESI_KT_GB2312.TTF
Normal file
BIN
document-docker/fonts/cesi/CESI_KT_GB2312.TTF
Normal file
Binary file not shown.
BIN
document-docker/fonts/cesi/CESI_SS_GB13000.TTF
Normal file
BIN
document-docker/fonts/cesi/CESI_SS_GB13000.TTF
Normal file
Binary file not shown.
BIN
document-docker/fonts/cesi/CESI_SS_GB18030.TTF
Normal file
BIN
document-docker/fonts/cesi/CESI_SS_GB18030.TTF
Normal file
Binary file not shown.
BIN
document-docker/fonts/cesi/CESI_SS_GB2312.TTF
Normal file
BIN
document-docker/fonts/cesi/CESI_SS_GB2312.TTF
Normal file
Binary file not shown.
BIN
document-docker/fonts/cesi/CESI_XBS_GB13000.TTF
Normal file
BIN
document-docker/fonts/cesi/CESI_XBS_GB13000.TTF
Normal file
Binary file not shown.
BIN
document-docker/fonts/cesi/CESI_XBS_GB18030.TTF
Normal file
BIN
document-docker/fonts/cesi/CESI_XBS_GB18030.TTF
Normal file
Binary file not shown.
BIN
document-docker/fonts/cesi/CESI_XBS_GB2312.TTF
Normal file
BIN
document-docker/fonts/cesi/CESI_XBS_GB2312.TTF
Normal file
Binary file not shown.
BIN
document-docker/fonts/gb/GB_FS_GB18030.ttf
Normal file
BIN
document-docker/fonts/gb/GB_FS_GB18030.ttf
Normal file
Binary file not shown.
BIN
document-docker/fonts/gb/GB_FS_GB2312.ttf
Normal file
BIN
document-docker/fonts/gb/GB_FS_GB2312.ttf
Normal file
Binary file not shown.
BIN
document-docker/fonts/gb/GB_HT_GB18030.ttf
Normal file
BIN
document-docker/fonts/gb/GB_HT_GB18030.ttf
Normal file
Binary file not shown.
BIN
document-docker/fonts/gb/GB_HT_GB2312.ttf
Normal file
BIN
document-docker/fonts/gb/GB_HT_GB2312.ttf
Normal file
Binary file not shown.
BIN
document-docker/fonts/gb/GB_KT_GB18030.ttf
Normal file
BIN
document-docker/fonts/gb/GB_KT_GB18030.ttf
Normal file
Binary file not shown.
BIN
document-docker/fonts/gb/GB_KT_GB2312.ttf
Normal file
BIN
document-docker/fonts/gb/GB_KT_GB2312.ttf
Normal file
Binary file not shown.
BIN
document-docker/fonts/gb/GB_ST_GB18030.ttf
Normal file
BIN
document-docker/fonts/gb/GB_ST_GB18030.ttf
Normal file
Binary file not shown.
BIN
document-docker/fonts/gb/GB_ST_GB2312.ttf
Normal file
BIN
document-docker/fonts/gb/GB_ST_GB2312.ttf
Normal file
Binary file not shown.
BIN
document-docker/fonts/gb/GB_ST_SUPER_EXTRA_GB2312.ttf
Normal file
BIN
document-docker/fonts/gb/GB_ST_SUPER_EXTRA_GB2312.ttf
Normal file
Binary file not shown.
BIN
document-docker/fonts/gb/GB_ST_SUPER_GB2312.ttf
Normal file
BIN
document-docker/fonts/gb/GB_ST_SUPER_GB2312.ttf
Normal file
Binary file not shown.
BIN
document-docker/fonts/gb/GB_XBS_GB18030.ttf
Normal file
BIN
document-docker/fonts/gb/GB_XBS_GB18030.ttf
Normal file
Binary file not shown.
BIN
document-docker/fonts/gb/GB_XBS_GB2312.ttf
Normal file
BIN
document-docker/fonts/gb/GB_XBS_GB2312.ttf
Normal file
Binary file not shown.
BIN
document-docker/fonts/wps-office/DejaVuMathTeXGyre.ttf
Normal file
BIN
document-docker/fonts/wps-office/DejaVuMathTeXGyre.ttf
Normal file
Binary file not shown.
BIN
document-docker/fonts/wps-office/FZFSK.TTF
Normal file
BIN
document-docker/fonts/wps-office/FZFSK.TTF
Normal file
Binary file not shown.
BIN
document-docker/fonts/wps-office/FZHTK.TTF
Normal file
BIN
document-docker/fonts/wps-office/FZHTK.TTF
Normal file
Binary file not shown.
BIN
document-docker/fonts/wps-office/FZKTK.TTF
Normal file
BIN
document-docker/fonts/wps-office/FZKTK.TTF
Normal file
Binary file not shown.
BIN
document-docker/fonts/wps-office/FZLSK.TTF
Normal file
BIN
document-docker/fonts/wps-office/FZLSK.TTF
Normal file
Binary file not shown.
BIN
document-docker/fonts/wps-office/FZSSK.TTF
Normal file
BIN
document-docker/fonts/wps-office/FZSSK.TTF
Normal file
Binary file not shown.
BIN
document-docker/fonts/wps-office/FZWBK.TTF
Normal file
BIN
document-docker/fonts/wps-office/FZWBK.TTF
Normal file
Binary file not shown.
BIN
document-docker/fonts/wps-office/FZXBSJW.TTF
Normal file
BIN
document-docker/fonts/wps-office/FZXBSJW.TTF
Normal file
Binary file not shown.
BIN
document-docker/fonts/wps-office/FZXBSK.TTF
Normal file
BIN
document-docker/fonts/wps-office/FZXBSK.TTF
Normal file
Binary file not shown.
BIN
document-docker/fonts/wps-office/HYFangSongJ.ttf
Normal file
BIN
document-docker/fonts/wps-office/HYFangSongJ.ttf
Normal file
Binary file not shown.
BIN
document-docker/fonts/wps-office/HYXingKaiJ.ttf
Normal file
BIN
document-docker/fonts/wps-office/HYXingKaiJ.ttf
Normal file
Binary file not shown.
BIN
document-docker/fonts/wps-office/HYZhongDengXianJ.ttf
Normal file
BIN
document-docker/fonts/wps-office/HYZhongDengXianJ.ttf
Normal file
Binary file not shown.
BIN
document-docker/fonts/wps-office/HYZhongSongJ.ttf
Normal file
BIN
document-docker/fonts/wps-office/HYZhongSongJ.ttf
Normal file
Binary file not shown.
@@ -1,6 +1,12 @@
|
||||
#!/bin/bash
|
||||
echo installing fonts
|
||||
sudo mkdir -p /usr/share/fonts/truetype
|
||||
sudo cp -r ./fonts/* /usr/share/fonts/truetype/
|
||||
sudo mkdir -p /usr/share/fonts/cesi
|
||||
sudo mkdir -p /usr/share/fonts/gb
|
||||
sudo mkdir -p /usr/share/fonts/wps-office
|
||||
sudo cp -r ./fonts/truetype/* /usr/share/fonts/truetype/
|
||||
sudo cp -r ./fonts/cesi/* /usr/share/fonts/cesi/
|
||||
sudo cp -r ./fonts/gb/* /usr/share/fonts/gb/
|
||||
sudo cp -r ./fonts/wps-office/* /usr/share/fonts/wps-office/
|
||||
sudo fc-cache -fv
|
||||
echo fonts installed
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.optima.document.test.bean;
|
||||
|
||||
import com.deepoove.poi.data.PictureRenderData;
|
||||
import com.deepoove.poi.data.Pictures;
|
||||
import com.optima.document.api.DocumentService;
|
||||
import com.optima.document.test.config.DocumentServiceConfig;
|
||||
@@ -45,8 +46,16 @@ public class DocumentConverter {
|
||||
params.put("departmentList", departmentList);
|
||||
|
||||
byte[] bytes = Files.readAllBytes(Paths.get("/Users/yanghuanglin/Downloads/02.png"));
|
||||
|
||||
params.put("img", Pictures.ofBytes(bytes).size(48, 27).create());
|
||||
|
||||
List<PictureRenderData> imgList = new ArrayList<>();
|
||||
imgList.add(Pictures.ofBytes(bytes).size(48, 27).create());
|
||||
imgList.add(Pictures.ofBytes(bytes).size(48, 27).create());
|
||||
params.put("imgList", imgList);
|
||||
|
||||
params.put("urlImg",Pictures.ofUrl("https://xct.cdhncy.cn/file/city/2025/10/28/fa03c40bdfc64a4f9e1241ebda6b3fda_1761641676690.jpeg").create());
|
||||
|
||||
// 生成word,并转为pdf
|
||||
byte[] generatedWord = documentService.generateWord(Files.readAllBytes(sourceFile.toPath()), params);
|
||||
byte[] wordedToPdf = documentService.wordToPdf(generatedWord, true);
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user