Free Support Forum - aspose.com

Watermark process


#1

Dear Team,

How to remove watermark in word document using Aspose java. I’ve attached input and expected output document for your reference.

Input : inp.zip (271.5 KB)

Expected OP :Exp_OP.zip (269.2 KB)

Thank you


#2

@ssvel,

Please try using the following code:

Document doc = new Document("E:\\temp\\input.docx");

HeaderFooter hf = doc.FirstSection.HeadersFooters[HeaderFooterType.HeaderPrimary];
Shape watermark = (Shape)hf.GetChildNodes(NodeType.Shape, true)[0];
watermark.Remove();

doc.Save("E:\\temp\\19.2.docx");

The standard way of removing watermark from Word document is mentioned in the following article:
How to Remove Watermark from a Document


#3

Its working fine. Thank you.