Hi,
I want to remove a specific watermark present in document. The found following code on aspose forum, which works fine if I don’t put check to compare watermark text.
==============================================================
Document doc = new Document("C:\\watermark.doc");
NodeCollection nodes = doc.getChildNodes(NodeType.SHAPE, true, false);
if (nodes == null || nodes.getCount() < 1)
{
return;
}
Node[] shapes = nodes.toArray();
int count = shapes.length;
for (int i = 0; i < count; i++)
{
Shape shape = (Shape)shapes[i];
String t = shape.getText();
System.out.println("wwww " + t);
// if (shape.getText().equalsIgnoreCase("DRAFT"))
{
shape.remove();
}
}
doc.save("C:\\Temp\\out.doc");
==============================================================
Is there any way to compare watermark text. I always get empty text for this shape object.
I am attaching sample file which I am using with this example.
I am using Aspose Word for Java 2.4
Thanks for your help.