Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// For complete examples and data files, please go to https://github.com/groupdocs-watermark/GroupDocs.Watermark-for-.NET
using (WordsDocument doc = Document.Load<WordsDocument>(Utilities.MapSourceFilePath (FilePath)))
{
// Initialize search criteria
ImageSearchCriteria imageSearchCriteria = new ImageDctHashSearchCriteria(@"D:\logo.png");
TextSearchCriteria textSearchCriteria = new TextSearchCriteria("Company Name");
// Call FindWatermarks method for the section
PossibleWatermarkCollection possibleWatermarks = doc.Sections[0].FindWatermarks(textSearchCriteria.Or(imageSearchCriteria));
// Remove all found watermarks
for (var i = possibleWatermarks.Count - 1; i >= 0; i--)
{
possibleWatermarks.RemoveAt(i);
}
doc.Save();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.