Watermarker Constructor (String, WatermarkerSettings)
Initializes a new instance of the Watermarker class with the specified document path and settings.

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

Parameters

filePath
Type: SystemString
The file path 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 (Watermarker watermarker = new Watermarker(file, settings))
    {
        PossibleWatermarkCollection watermarks = watermarker.Search();

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