Apply watermarks to a whole folder of documents in a single pass and replace old logos when needed. The examples show how to:
- Add a tiled text watermark to every supported file
- Add a tiled image (logo) watermark to every supported file
- Apply a text watermark only when it does not already exist (idempotent processing)
- Find and replace an outdated logo across a folder of documents
- .NET 6+ installed
- GroupDocs.Watermark for .NET package
- A temporary or permanent GroupDocs license (see the product documentation for a trial license)
- Input files in formats supported by GroupDocs.Watermark (DOCX, PDF, XLSX, PPTX, images, etc.)
Steps
- Create the output folder.
- Iterate over each supported file.
- Instantiate
Watermarkerfor the file. - Build a
TextWatermarkwithTileOptions. - Add the watermark and save the result.
Code reference: ApplyBatchTextWatermark.cs
Steps
- Verify the logo image exists.
- Create the output folder.
- Loop through all supported files.
- Instantiate
Watermarkerand anImageWatermark. - Configure opacity, rotation and tiling.
- Add the watermark and save the result.
Code reference: ApplyBatchLogoWatermark.cs
Steps
- Create the output folder.
- For each file, search for the watermark text using
TextSearchCriteria. - If a watermark is found, skip the file; otherwise, add the new watermark.
- Save the processed file.
Code reference: ApplySmartBatchWatermark.cs
Steps
- Ensure both old and new logo files exist.
- Create the output folder.
- Configure
WatermarkerSettingsto enable searchable PDF objects. - For each file, search for the old logo using DCT‑hash and color‑histogram criteria.
- Replace the image data of each found watermark with the new logo bytes.
- Save the updated document.
Code reference: ReplaceLogoAcrossFolder.cs
- Install the GroupDocs.Watermark NuGet package.
- Add the desired code file to your project.
- Provide the input folder path, output folder path, watermark text or logo paths as required.
- Run the example – processed files will appear in the output folder.
- Add Watermark to a Batch of Documents and Images in .NET and Java
- How to Generate a Tiling Watermark
For detailed API reference and additional use‑cases, see the official documentation at https://docs.groupdocs.com/watermark/net/.