|
|
@ -38,9 +38,9 @@ public class DocPdfComponent { |
|
|
|
/** |
|
|
|
* 根据ftl模板生成word |
|
|
|
* |
|
|
|
* @param map 数据 |
|
|
|
* @param typeName 模板名称 |
|
|
|
* @param fileName 文件名 |
|
|
|
* @param map 数据 |
|
|
|
* @param typeName 模板名称 |
|
|
|
* @param fileName 文件名 |
|
|
|
* @return 返回word文件路径和链接路径 |
|
|
|
*/ |
|
|
|
public Map<String, String> creatWord(Map<String, Object> map, String typeName, String fileName) { |
|
|
@ -79,6 +79,7 @@ public class DocPdfComponent { |
|
|
|
|
|
|
|
/** |
|
|
|
* 图片文件转换 |
|
|
|
* |
|
|
|
* @param imgPath |
|
|
|
* @return |
|
|
|
*/ |
|
|
@ -99,6 +100,7 @@ public class DocPdfComponent { |
|
|
|
|
|
|
|
/** |
|
|
|
* word转换为pdf |
|
|
|
* |
|
|
|
* @param wordFile word的路径 |
|
|
|
* @param pdfName pdf名称 |
|
|
|
* @return 返回pdf文件路径和链接路径 |
|
|
@ -129,8 +131,10 @@ public class DocPdfComponent { |
|
|
|
Dispatch.call(document, "SaveAs", pdfFile, 17); |
|
|
|
// 关闭文档
|
|
|
|
Dispatch.call(document, "Close", false); |
|
|
|
String prefixUrl = prefixTemplateUrl + pdfFile.replace(uploadTemplateUrl, ""); |
|
|
|
// String prefixUrl = prefixTemplateUrl + pdfFile.replace(uploadTemplateUrl, "");
|
|
|
|
resultMap.put("uploadTemplateUrl", pdfFile); // 文件路径
|
|
|
|
pdfFile = targetPath + "/" + pdfName; |
|
|
|
String prefixUrl = prefixTemplateUrl + pdfFile.replace(uploadTemplateUrl, ""); |
|
|
|
resultMap.put("prefixTemplateUrl", prefixUrl); // 链接路径
|
|
|
|
} catch (Exception e) { |
|
|
|
log.error("转换失败" + e.getMessage()); |
|
|
@ -143,6 +147,7 @@ public class DocPdfComponent { |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据ftl模板生成word并转为pdf |
|
|
|
* |
|
|
|
* @param map |
|
|
|
* @param typeName |
|
|
|
* @param docName |
|
|
|