在工作表上添加Word Art水印使用Aspose.Cells

Aspose.Cells - 在工作表中添加Word Art水印

使用WordArt在电子表格中添加特殊文本效果。例如,将标题跨越文件顶部、装饰文本、使文本适应预设形状,或将文本应用于Excel工作表作为背景水印。WordArt变成一个对象,您可以移动或定位在电子表格中添加装饰。

Java

 Workbook workbook = new Workbook();

//Get the first default sheet

Worksheet sheet = workbook.getWorksheets().get(0);

//Add Watermark

Shape wordart = sheet.getShapes().addTextEffect(MsoPresetTextEffect.TEXT_EFFECT_1,

"CONFIDENTIAL", "Arial Black", 50, false, true

, 18, 8, 1, 1, 130, 800);

//Get the shape's fill format

FillFormat wordArtFormat = wordart.getFill();

//Set the transparency

wordArtFormat.setTransparency(0.9);

//Make the line invisible

wordart.setHasLine(false);

//Save the file

workbook.save(dataDir + "AsposeWatermark_Out.xls");

下载运行代码

下载示例代码