Watermarker Constructor (String, WatermarkerSettings) |
Initializes a new instance of the
Watermarker class with the specified
document path and settings.
Namespace: GroupDocs.WatermarkAssembly: GroupDocs.Watermark (in GroupDocs.Watermark.dll) Version: 20.7.0
Syntaxpublic Watermarker(
string filePath,
WatermarkerSettings settings
)
Public Sub New (
filePath As String,
settings As WatermarkerSettings
)
public:
Watermarker(
String^ filePath,
WatermarkerSettings^ settings
)
new :
filePath : string *
settings : WatermarkerSettings -> Watermarker
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
Remarks
Examples
Set searchable objects globally (for all documents that will be loaded after that).
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();
}
}
See Also