feat: There is no way the,
This commit is contained in:
@@ -49,18 +49,18 @@ public class WaterMarkUtil {
|
|||||||
// set Transparency
|
// set Transparency
|
||||||
PdfGState gs = new PdfGState();
|
PdfGState gs = new PdfGState();
|
||||||
// 设置透明度为0.2
|
// 设置透明度为0.2
|
||||||
gs.setFillOpacity(0.5f);
|
gs.setFillOpacity(0.4f);
|
||||||
under.setGState(gs);
|
under.setGState(gs);
|
||||||
under.restoreState();
|
under.restoreState();
|
||||||
under.beginText();
|
under.beginText();
|
||||||
under.setFontAndSize(base, 25);
|
under.setFontAndSize(base, 36);
|
||||||
under.setTextMatrix(30, 30);
|
under.setTextMatrix(30, 30);
|
||||||
under.setColorFill(BaseColor.LIGHT_GRAY);
|
under.setColorFill(BaseColor.LIGHT_GRAY);
|
||||||
for (int y = 0; y < 10; y++) {
|
for (int y = 0; y < 10; y++) {
|
||||||
for (int x = 0; x < 8; x++) {
|
for (int x = 0; x < 8; x++) {
|
||||||
// 水印文字成45度角倾斜
|
// 水印文字成45度角倾斜
|
||||||
under.showTextAligned(Element.ALIGN_LEFT
|
under.showTextAligned(Element.ALIGN_LEFT
|
||||||
, waterMarkName, 100 + 300 * x, 300 * y, 45); }
|
, waterMarkName, 100 + 300 * x, 300 * y, 40); }
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加水印文字
|
// 添加水印文字
|
||||||
|
|||||||
@@ -275,14 +275,14 @@ public class AttFileEOController {
|
|||||||
String userMsg = "";
|
String userMsg = "";
|
||||||
TsUser tsUser = userDao.selectById(userId);
|
TsUser tsUser = userDao.selectById(userId);
|
||||||
if (tsUser != null) {
|
if (tsUser != null) {
|
||||||
userMsg = tsUser.getUname() + ",";
|
userMsg = tsUser.getUname();
|
||||||
if (StringUtils.isNotEmpty(tsUser.getWorkNum())) {
|
// if (StringUtils.isNotEmpty(tsUser.getWorkNum())) {
|
||||||
userMsg += tsUser.getWorkNum() + ",";
|
// userMsg += tsUser.getWorkNum() + ",";
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm");//设置日期格式
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm");//设置日期格式
|
||||||
String date = df.format(new Date());
|
String date = df.format(new Date());
|
||||||
String waterContent = userMsg + date;
|
String waterContent = userMsg;
|
||||||
//2020年9月5日 去掉水印处理
|
//2020年9月5日 去掉水印处理
|
||||||
//2021年7月25日要求下载生成水印
|
//2021年7月25日要求下载生成水印
|
||||||
WaterMarkUtil.waterMark(oldFilePath,waterFilePath,waterContent);
|
WaterMarkUtil.waterMark(oldFilePath,waterFilePath,waterContent);
|
||||||
|
|||||||
Reference in New Issue
Block a user