Aspose check if watermark exists in workbook.If exists watermark should not create

Iam creating Watermark in excel its working good, I need to have one condition that to check weather watermark exists in workbook if its exists i should not overwrite the workbook.

	Workbook workbook = new Workbook(file);
	int count = workbook.getWorksheets().getCount();

//Instantiate a new Workbook
Workbook workbook = new Workbook(file);
// System.out.println(file);
int count = workbook.getWorksheets().getCount();

	for (int index = 0; index < count; index++)
	//Iterating into each sheet in workbook		
	Worksheet sheet = workbook.getWorksheets().get(index);
	//Add Watermark
	Shape wordart = sheet.getShapes().addTextEffect(MsoPresetTextEffect.TEXT_EFFECT_1,
	"TEST", "Arial Black", 50, false, true
	, 18, 8, 1, 1, 130, 800);
	//Get the fill format of the word art
	FillFormat wordArtFormat = wordart.getFill();

	//Set the color
	wordArtFormat.setOneColorGradient(Color.getRed(), 0.2, GradientStyleType.HORIZONTAL, 2);

	//Set the transparency

	//Make the line invisible
	//LineFormat lineFormat = wordart.getLine();

	// Lock Shape Aspects
	wordart.setLockedProperty(ShapeLockType.SELECTION, true);
	wordart.setLockedProperty(ShapeLockType.SHAPE_TYPE, true);
	wordart.setLockedProperty(ShapeLockType.MOVE, true);
	wordart.setLockedProperty(ShapeLockType.RESIZE, true);
	wordart.setLockedProperty(ShapeLockType.TEXT, true);

	//Save the file;


We have logged an issue in our database to further investigate your scenario. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSJAVA-42694 - Check watermark in Excel file


This is to inform you that we have fixed your issue (logged earlier as “CELLSJAVA-42694”) now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.

The issues you have found earlier (filed as CELLSJAVA-42694) have been fixed in Aspose.Cells for Java 18.8. You can also get the latest Aspose.Cells for Java version from Maven repos. with simple configurations. Please see the document for your reference: Installation|Documentation

This message was posted using BugNotificationTool from Downloads module by Amjad_Sahi