Compare commits
6 Commits
1.0.0
...
62d62811fc
| Author | SHA1 | Date | |
|---|---|---|---|
| 62d62811fc | |||
| 2aadb288c0 | |||
| 268769c02c | |||
| 837028762b | |||
| 7f1c9af201 | |||
| 434a751575 |
@@ -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:
|
||||||
|
|||||||
@@ -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镜像构建成功.
|
||||||
|
|
||||||
# 清理临时文件
|
# 清理临时文件
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user