Compare commits

8 Commits

Author SHA1 Message Date
杨黄林
461564a615 增加CESI、国标(GB)、WPS字体 2026-01-08 15:08:55 +08:00
b0082a57c7 调整说明 2025-12-01 11:03:10 +08:00
62d62811fc Merge remote-tracking branch 'origin/master' 2025-11-24 11:13:37 +08:00
2aadb288c0 修复导出镜像失败问题 2025-11-24 11:13:22 +08:00
268769c02c 更新 README.md 2025-11-19 12:48:21 +08:00
837028762b 增加网络图片示例 2025-11-17 16:21:50 +08:00
7f1c9af201 增加图片列表渲染示例 2025-11-17 16:00:21 +08:00
434a751575 增加镜像创建人 2025-11-17 12:39:04 +08:00
70 changed files with 178 additions and 164 deletions

View File

@@ -11,7 +11,7 @@
+ [docto-document-server](document-server/docto-document-server)下使用poi-tl处理word文件使用docto调用`Microsoft Office`来转换格式,`java -jar xxx.jar`启动 + [docto-document-server](document-server/docto-document-server)下使用poi-tl处理word文件使用docto调用`Microsoft Office`来转换格式,`java -jar xxx.jar`启动
+ 仅能运行在Windows兼容性最好比较慢 + 仅能运行在Windows兼容性最好比较慢
+ [document-fonts](document-fonts)为linux下需要安装的中文字体 + [document-docker/fonts](document-docker/fonts)为linux下需要安装的中文字体
--- ---
@@ -98,10 +98,6 @@ services:
- GRAMER_CUSTOMIZE_LIST="%" - GRAMER_CUSTOMIZE_LIST="%"
- GRAMER_CUSTOMIZE_LIST_STRING_DELIMITING="" - GRAMER_CUSTOMIZE_LIST_STRING_DELIMITING=""
ports: ports:
# 用于通过http访问libreoffice
- 3000:3000
# 用于通过https访问libreoffice
- 3001:3001
# 文书转换服务端口用于document-api远程调用document-server # 文书转换服务端口用于document-api远程调用document-server
- 9004:9004 - 9004:9004
volumes: volumes:

View File

@@ -44,7 +44,10 @@ COPY app/document-server-*.jar /app/application.jar
COPY app/application.yml /app/application.yml 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 RUN fc-cache -fv
# 入口 # 入口

View File

@@ -18,16 +18,16 @@ cp ../document-server/jodconverter-document-server/target/application.yml app/
#amd64 #amd64
echo 开始构建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 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镜像构建成功. echo amd64镜像构建成功.
#arm64 #arm64
echo 开始构建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 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镜像构建成功. echo arm64镜像构建成功.
# 清理临时文件 # 清理临时文件

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,6 +1,12 @@
#!/bin/bash #!/bin/bash
echo installing fonts echo installing fonts
sudo mkdir -p /usr/share/fonts/truetype 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 sudo fc-cache -fv
echo fonts installed echo fonts installed

View File

@@ -1,5 +1,6 @@
package com.optima.document.test.bean; package com.optima.document.test.bean;
import com.deepoove.poi.data.PictureRenderData;
import com.deepoove.poi.data.Pictures; import com.deepoove.poi.data.Pictures;
import com.optima.document.api.DocumentService; import com.optima.document.api.DocumentService;
import com.optima.document.test.config.DocumentServiceConfig; import com.optima.document.test.config.DocumentServiceConfig;
@@ -45,8 +46,16 @@ public class DocumentConverter {
params.put("departmentList", departmentList); params.put("departmentList", departmentList);
byte[] bytes = Files.readAllBytes(Paths.get("/Users/yanghuanglin/Downloads/02.png")); byte[] bytes = Files.readAllBytes(Paths.get("/Users/yanghuanglin/Downloads/02.png"));
params.put("img", Pictures.ofBytes(bytes).size(48, 27).create()); 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 // 生成word并转为pdf
byte[] generatedWord = documentService.generateWord(Files.readAllBytes(sourceFile.toPath()), params); byte[] generatedWord = documentService.generateWord(Files.readAllBytes(sourceFile.toPath()), params);
byte[] wordedToPdf = documentService.wordToPdf(generatedWord, true); byte[] wordedToPdf = documentService.wordToPdf(generatedWord, true);