How to add a watermark to a Excel worksheet

I am new to Aspose Cells. So far have been able to figure out how to generate Excel files with our web application using Aspose Cells.

Next step is to figure out how to show a watermark on the worksheet. Is this possible in Apsose Cells for Java? I see it is possible with Aspose Cells for .Net. I would like to add a wordart type of watermark where I can change the transparency value.

Thank you for any help.

Hi,

Thanks for your posting and using Aspose.Cells for Java

Yes, it is quite possible to add a watermark using Aspose.Cells for Java.

Please see the code below, it adds a watermark CONFIDENTIAL in a worksheet.

Please download and use the latest version: Aspose.Cells
for Java v7.2.0.6



I have also attached the output file generated by the code and the screenshot.

Java


// Add Watermark

Workbook workbook = new Workbook();

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


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

“CONFIDENTIAL”, “Arial Black”, 50, false, true

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


MsoFillFormat wordArtFormat = wordart.getFillFormat();

wordArtFormat.setForeColor(Color.getRed());

wordArtFormat.setTransparency(0.9);

MsoLineFormat lineFormat = wordart.getLineFormat();

lineFormat.setVisible(false);


workbook.save(“F:\output.xls”);


Screenshot:

Hi,


Moreover, I have also written and added the similar article (as .NET) into Aspose.Cells for Java documentation, please see the document for your reference:
http://www.aspose.com/docs/display/cellsjava/Add+WordArt+Watermark+to+Worksheet


Thank you.

Thank you so much for your help. I will try that.

Hi,

You are welcome and thanks for trying Aspose.Cells.

Let us know if you face any other issue, we will be glad to assist you further.