Watermarker Constructor (Stream, WatermarkerSettings)
Initializes a new instance of the Watermarker class with the specified stream and settings.

Namespace: GroupDocs.Watermark
Assembly: GroupDocs.Watermark (in GroupDocs.Watermark.dll) Version: 20.7.0
Syntax
public Watermarker(
	Stream document,
	WatermarkerSettings settings
)

Parameters

document
Type: System.IOStream
The stream to load document from.
settings
Type: GroupDocs.WatermarkWatermarkerSettings
Additional settings to use when working with loaded document.
Exceptions
ExceptionCondition
UnsupportedFileTypeExceptionSupplied document type is not supported.
InvalidPasswordExceptionSupplied password is incorrect.
Remarks
Learn more about loading documents Loading documents.
Examples
Set searchable objects globally (for all documents that will be loaded after that).
C#
WatermarkerSettings settings = new WatermarkerSettings();
settings.SearchableObjects = new SearchableObjects
{
    WordProcessingSearchableObjects = WordProcessingSearchableObjects.Hyperlinks
                                    | WordProcessingSearchableObjects.Text,
    SpreadsheetSearchableObjects = SpreadsheetSearchableObjects.HeadersFooters,
    PresentationSearchableObjects = PresentationSearchableObjects.SlidesBackgrounds
                                  | PresentationSearchableObjects.Shapes,
    DiagramSearchableObjects = DiagramSearchableObjects.None,
    PdfSearchableObjects = PdfSearchableObjects.All
};

foreach (string file in Directory.GetFiles(@"D:\files"))
{
    using (FileStream fileStream = File.Open(file, FileMode.Open))
    using (Watermarker watermarker = new Watermarker(fileStream, settings))
    {
        PossibleWatermarkCollection watermarks = watermarker.Search();

        // The code for working with found watermarks goes here.
    }
}
See Also