Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GroupDocsGists/cb4a19f8105329bb3536c23d25de5a9f to your computer and use it in GitHub Desktop.
Save GroupDocsGists/cb4a19f8105329bb3536c23d25de5a9f to your computer and use it in GitHub Desktop.
// For complete examples and data files, please go to https://github.com/groupdocs-watermark/GroupDocs.Watermark-for-.NET
using (Document doc = Document.Load(Utilities.MapSourceFilePath(DocFilePath)))
{
TextFormattingSearchCriteria criteria = 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;
PossibleWatermarkCollection watermarks = doc.FindWatermarks(criteria);
watermarks.Clear();
doc.Save();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment