Remove
Remove(PossibleWatermark)
Removes watermark from the document.
public void Remove(PossibleWatermark possibleWatermark)
Parameter | Type | Description |
---|---|---|
possibleWatermark | PossibleWatermark | The watermark to remove. |
Remarks
Learn more about removing watermarks: Removing found watermarks.
Examples
Find and remove the first possible watermark containing particular text or image from a document of any supported type.
using (Watermarker watermarker = new Watermarker(@"D:\input.doc"))
{
ImageSearchCriteria imageSearchCriteria = new ImageDctHashSearchCriteria(@"D:\logo.png");
Regex regex = new Regex(@"^Company\sName$", RegexOptions.IgnoreCase);
TextSearchCriteria textSearchCriteria = new TextSearchCriteria(regex);
PossibleWatermarkCollection watermarks = watermarker.Search(textSearchCriteria.Or(imageSearchCriteria));
if (watermarks.Count > 0)
{
watermarker.Remove(watermarks[0]);
}
watermarker.Save(@"D:\output.doc");
}
See Also
- class PossibleWatermark
- class Watermarker
- namespace GroupDocs.Watermark
- assembly GroupDocs.Watermark
Remove(PossibleWatermarkCollection)
Removes all watermarks in the collection from the document.
public void Remove(PossibleWatermarkCollection possibleWatermarks)
Parameter | Type | Description |
---|---|---|
possibleWatermarks | PossibleWatermarkCollection | The collection of watermarks to remove. |
Remarks
Learn more about removing watermarks Removing found watermarks.
Examples
Find and remove all possible watermarks containing particular text or image from a document of any supported type.
using (Watermarker watermarker = new Watermarker(@"D:\input.doc"))
{
ImageSearchCriteria imageSearchCriteria = new ImageDctHashSearchCriteria(@"D:\logo.png");
Regex regex = new Regex(@"^Company\sName$", RegexOptions.IgnoreCase);
TextSearchCriteria textSearchCriteria = new TextSearchCriteria(regex);
PossibleWatermarkCollection watermarks = watermarker.Search(textSearchCriteria.Or(imageSearchCriteria));
watermarker.Remove(watermarks);
watermarker.Save(@"D:\output.doc");
}
See Also
- class PossibleWatermarkCollection
- class Watermarker
- namespace GroupDocs.Watermark
- assembly GroupDocs.Watermark