usmanazizgroupdocs
5/9/2017 - 3:14 PM

RemoveWatermarkVisio.cs

// For complete examples and data files, please go to https://github.com/groupdocs-watermark/GroupDocs.Watermark-for-.NET
using (DiagramDocument doc = Document.Load<DiagramDocument>(Utilities.MapSourceFilePath(FilePath)))
{
    // Initialize search criteria
    ImageSearchCriteria imageSearchCriteria = new ImageDctHashSearchCriteria(@"D:\logo.png");
    TextSearchCriteria textSearchCriteria = new TextSearchCriteria("Company Name");

    // Call FindWatermarks method for the first page
    PossibleWatermarkCollection possibleWatermarks = doc.Pages[0].FindWatermarks(textSearchCriteria.Or(imageSearchCriteria));

    // Remove all found watermarks
    possibleWatermarks.Clear();

    doc.Save();
}