|
@ -448,11 +448,6 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
WordUtils.creatWord(dataMap, "prePaymentApply", sourcePath, targetPath, typeName); |
|
|
WordUtils.creatWord(dataMap, "prePaymentApply", sourcePath, targetPath, typeName); |
|
|
//新生成的word路径
|
|
|
//新生成的word路径
|
|
|
String wordPath = targetPath + "\\" + typeName; |
|
|
String wordPath = targetPath + "\\" + typeName; |
|
|
//为生成的word文档添加水印
|
|
|
|
|
|
/* Document document = new Document(); |
|
|
|
|
|
document.loadFromFile("sample.docx"); //插入文本水印
|
|
|
|
|
|
InsertTextWatermark(document.getSections().get(0)); //保存文档
|
|
|
|
|
|
document.saveToFile("textwatermark.docx",FileFormat.Docx );*/ |
|
|
|
|
|
//生成出门证文件名
|
|
|
//生成出门证文件名
|
|
|
String pdfName = "预付款申请_" + dateStr + seconds + ".pdf"; |
|
|
String pdfName = "预付款申请_" + dateStr + seconds + ".pdf"; |
|
|
WordUtils.doc2pdf(wordPath, targetPath, pdfName,createByName); |
|
|
WordUtils.doc2pdf(wordPath, targetPath, pdfName,createByName); |
|
@ -472,16 +467,6 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
return rb.success().setData(pdfPath); |
|
|
return rb.success().setData(pdfPath); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//自定义方法指定文本水印字样,并设置成水印
|
|
|
|
|
|
/*private static void InsertTextWatermark(Section section) { |
|
|
|
|
|
TextWatermark txtWatermark = new TextWatermark(); |
|
|
|
|
|
txtWatermark.setText("内部使用"); |
|
|
|
|
|
txtWatermark.setFontSize(40); |
|
|
|
|
|
txtWatermark.setColor(Color.red); |
|
|
|
|
|
txtWatermark.setLayout(WatermarkLayout.Diagonal); |
|
|
|
|
|
section.getDocument().setWatermark(txtWatermark); |
|
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
|
|
public static String image2Base64(String imgUrl) { |
|
|
public static String image2Base64(String imgUrl) { |
|
|
byte[] data = null; |
|
|
byte[] data = null; |
|
|
// 读取图片字节数组
|
|
|
// 读取图片字节数组
|
|
@ -495,7 +480,6 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
e.printStackTrace(); |
|
|
e.printStackTrace(); |
|
|
} |
|
|
} |
|
|
// 对字节数组进行Base64编码,得到Base64编码的字符串
|
|
|
// 对字节数组进行Base64编码,得到Base64编码的字符串
|
|
|
//BASE64Encoder encoder = new BASE64Encoder();
|
|
|
|
|
|
Base64.Encoder encoder = Base64.getEncoder(); |
|
|
Base64.Encoder encoder = Base64.getEncoder(); |
|
|
String base64Str = encoder.encodeToString(data); |
|
|
String base64Str = encoder.encodeToString(data); |
|
|
return base64Str; |
|
|
return base64Str; |
|
|