Commit 65c618de authored by suhuiguang's avatar suhuiguang

1.调整字体颜色

parent d1f77a6f
......@@ -95,7 +95,7 @@ public class PdfUtils {
stamper = new PdfStamper(reader, new FileOutputStream(outputPdfFile));
PdfGState gs = new PdfGState();
// 设置透明度为0.1
gs.setFillOpacity(0.2f);
gs.setFillOpacity(0.5f);
int n = reader.getNumberOfPages();
// 创建一个BaseFont实例,用于水印文本
BaseFont bf = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.EMBEDDED);
......@@ -125,7 +125,7 @@ public class PdfUtils {
over.beginText();
over.setFontAndSize(bf, fontSize);
//水印颜色
over.setColorFill(BaseColor.BLACK);
over.setColorFill(BaseColor.LIGHT_GRAY);
over.setGState(gs);
// 设置文本渲染模式为填充,使文本不可选择
over.setTextRenderingMode(PdfContentByte.TEXT_RENDER_MODE_FILL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment