3.10.0及后续版本支持水印添加
依赖引入
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>ooxml-schemas</artifactId>
<version>1.4</version>
</dependency>
使用
import com.github.liaochong.myexcel.utils.WatermarkUtil;
List<ArtCrowd> dataList = this.getDataList();
Workbook workbook = DefaultExcelBuilder.of(ArtCrowd.class).build(dataList);
// 使用水印工具添加水印
WatermarkUtil.addWatermark(workbook,"艺术生水印");
AttachmentExportUtil.export(workbook, "艺术生信息", response);