GroupDocsGists
10/19/2017 - 10:58 AM

RemoveWatermarkWithParticularTextFormatting.vb

' For complete examples and data files, please go to https://github.com/groupdocs-watermark/GroupDocs.Watermark-for-.NET
Using doc As Document = Document.Load(Utilities.MapSourceFilePath(DocFilePath))
    Dim criteria As New TextFormattingSearchCriteria()
    criteria.ForegroundColorRange = New ColorRange()
    criteria.ForegroundColorRange.MinHue = -5
    criteria.ForegroundColorRange.MaxHue = 10
    criteria.ForegroundColorRange.MinBrightness = 0.01F
    criteria.ForegroundColorRange.MaxBrightness = 0.99F
    criteria.BackgroundColorRange = New ColorRange()
    criteria.BackgroundColorRange.IsEmpty = True
    criteria.FontName = "Arial"
    criteria.MinFontSize = 19
    criteria.MaxFontSize = 42
    criteria.FontBold = True

    Dim watermarks As PossibleWatermarkCollection = doc.FindWatermarks(criteria)
    watermarks.Clear()
    doc.Save()