Easily find and modify existing text watermarks in documents. With Python, you can search for a watermark by its text content and update it with a new value.
importgroupdocs.watermarkasgwimportgroupdocs.watermark.search.searchcriteriaasgws_scwithgw.Watermarker("C:\\Docs\\watermarked-sample.docx")aswatermarker:criteria=gws_sc.TextSearchCriteria("Contract Draft",False)possible=watermarker.search(criteria)print("Found",possible.count,"possible watermark(s).")forwminpossible:try:wm.text="Contract is no longer valid"exceptException:passwatermarker.save("C:\\Docs\\updated-sample.docx")
Updating image watermarks
Quickly replace old or incorrect image watermarks with new ones. Python developers can search for an image watermark using perceptual hashing and swap it with an updated logo or graphic.