Search for possible watermarks and remove them from the document.
importgroupdocs.watermarkasgwwithgw.Watermarker("document.pdf")aswatermarker:possible=watermarker.search()# Remove watermark at the specified indexpossible.remove_at(0)# Remove a specific watermark instanceifpossible.count>0:possible.remove(possible[0])watermarker.save("document.pdf")
Remove watermark with particular text formatting
Search and clear watermarks that match font and color parameters.
Find and remove hyperlinks with a particular URL using a regex. Ensure only hyperlinks are cleared.
importreimportgroupdocs.watermarkasgwimportgroupdocs.watermark.search.searchcriteriaasgws_scimportgroupdocs.watermark.searchasgwswithgw.Watermarker("document.pdf")aswatermarker:possible=watermarker.search(gws_sc.TextSearchCriteria(re.compile(r"someurl\.com")))# iterate backwards when removing by indexforiinrange(possible.count-1,-1,-1):ifisinstance(possible[i],gws.HyperlinkPossibleWatermark):print(possible[i].text)possible.remove_at(i)watermarker.save("document.pdf")
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.
On this page
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.