添加字体库设置

This commit is contained in:
付庆吉
2021-08-23 15:21:44 +08:00
parent c94fec0246
commit 7d4c91c2e2
5 changed files with 11 additions and 2 deletions

View File

@ -44,6 +44,9 @@ public class ExpertSignatureServiceImpl implements ExpertSignatureService {
@Value("${mconfig.file.upload-address}")
private String uploadAddress;
@Value("${mconfig.file.font-address}")
private String fontAddress;
private String getUploadAddress(String assessRoomId) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
@ -81,7 +84,9 @@ public class ExpertSignatureServiceImpl implements ExpertSignatureService {
//上传pdf到文档中心
String pdfId = PropertyUtils.getSnowflakeId();
attachmentClient.upload(pdfId, entity.getFilename(), pdf);
String filename = entity.getFilename();
filename = filename.substring(0, filename.lastIndexOf(".")) + ".pdf";
attachmentClient.upload(pdfId, filename, pdf);
return pdfId;
}
@ -119,7 +124,7 @@ public class ExpertSignatureServiceImpl implements ExpertSignatureService {
File f = new File(path + "merged.pdf");
FileOutputStream fos = new FileOutputStream(f);
FontSettings.getDefaultInstance().setFontsFolder("/storage/fonts/",true);
FontSettings.getDefaultInstance().setFontsFolder(fontAddress, true);
try {
com.aspose.words.Document doc = new com.aspose.words.Document(path + "merged.docx");
doc.save(fos, SaveFormat.PDF);

View File

@ -173,6 +173,7 @@ mconfig:
documentcenter: core-service-document-center #文档中心
usercenter: core-service-usercenter-public #用户中心
file:
font-address: /storage/fonts/
upload-address: /storage/reviewReport/
document:
clientHttpUrl: http://10.242.31.158:8100/auth/oauth/token?grant_type=client_credentials&client_id=bVS46ElU&client_secret=58ea04ba02475c8da2321cc99849d2a10f15b749

View File

@ -165,6 +165,7 @@ mconfig:
documentcenter: core-service-document-center #文档中心
usercenter: core-service-usercenter-public #用户中心
file:
font-address: /storage/fonts/
upload-address: /storage/reviewReport/
document:

View File

@ -168,6 +168,7 @@ mconfig:
documentcenter: core-service-document-center #文档中心
usercenter: core-service-usercenter-public #用户中心
file:
font-address: /storage/fonts/
upload-address: /storage/reviewReport/
document:
clientHttpUrl: http://10.238.25.112:8100/auth/oauth/token?grant_type=client_credentials&client_id=bVS46ElU&client_secret=58ea04ba02475c8da2321cc99849d2a10f15b749

View File

@ -168,6 +168,7 @@ mconfig:
documentcenter: core-service-document-center #文档中心
usercenter: core-service-usercenter-public #用户中心
file:
font-address: /storage/fonts/
upload-address: /storage/reviewReport/
document:
clientHttpUrl: http://10.242.31.158:8100/auth/oauth/token?grant_type=client_credentials&client_id=bVS46ElU&client_secret=58ea04ba02475c8da2321cc99849d2a10f15b749