Free Support Forum -

Remove text watermark


Dear Team,

Please provide source code in JAVA to remove text watermark from
Excel, PPT, Word, Pdf and images files.



Thank you for contacting support.

You may remove watermark text from Word documents with Aspose.Words for Java, as explained in Working with Watermark.

For other file formats, please share sample documents as ZIP files so that we may investigate further and assist you accordingly.


Dear Team,

Please find the attached document for remove the (669.9 KB)

#4 (557.9 KB)

Please find the attached document with watermark.



Thanks for sharing the documents.

To remove watermark from XLSX, please use the following code example.

Workbook wb = new Workbook("c:\\temp\\Test_xlsx_20181119_4042.xlsx");
Worksheet ws = wb.getWorksheets().get(0);
int cnt = ws.getShapes().getCount();
for (int i = cnt-1; i >=0; i--)
    Shape shape = ws.getShapes().get(i);
    if (shape.isWordArt())

Following code example shows how to remove watermark from PPTX.

String path="C:\\temp\\Watermark\\";
String WatermarkText="";
com.aspose.slides.Presentation pres = new com.aspose.slides.Presentation(path+"Test_Pptx_20181119_4047.pptx");
com.aspose.slides.ISlideCollection slds = (com.aspose.slides.ISlideCollection) pres.getSlides();

IMasterSlide master=pres.getMasters().get_Item(0);
for(int i=0;i<master.getShapes().size();i++)
    IShape shape=master.getShapes().get_Item(i);
    if(shape instanceof IAutoShape)
        IAutoShape ashp=(IAutoShape)shape;


}"c:\\temp\\RemovedWatermark.pptx", SaveFormat.Pptx);

Please use following code example to remove the watermark from the Word document.

Document doc = new Document(MyDir + "Test_Docx_20181119_4132.docx");
for(Section section : doc.getSections())
    for(HeaderFooter headerFooter : section.getHeadersFooters())
        NodeCollection shapes = headerFooter.getChildNodes(NodeType.SHAPE, true);
        for (Shape shape : (Iterable<Shape>) shapes)
            if(shape.getTextPath() != null && shape.getTextPath().getText().trim().length() > 0)
} + "output.docx");