Watermarks in word processing document

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Watermark MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-watermark -- dnx GroupDocs.Watermark.Mcp --yes
Folders, licensing and more →

When you add a watermark to a Microsoft Word document, a shape with the appropriate content is placed in the section headers. WordProcessingWatermarkSectionOptions (and WordProcessingWatermarkPagesOptions) let you set the shape’s name and alternative_text, and apply text or image effects through the effects property.

Add an image watermark with effects

The example applies brightness, contrast, and a chroma-key to an image watermark using WordProcessingImageEffects.

from groupdocs.watermark import Watermarker
from groupdocs.watermark.watermarks import ImageWatermark, Color
from groupdocs.watermark.options.word_processing import (
    WordProcessingLoadOptions, WordProcessingWatermarkSectionOptions, WordProcessingImageEffects,
)

def add_watermark_with_effects():
    with Watermarker("./document.docx", WordProcessingLoadOptions()) as watermarker:
        with ImageWatermark("./logo.png") as watermark:
            effects = WordProcessingImageEffects()
            effects.brightness = 0.7
            effects.contrast = 0.6
            effects.chroma_key = Color.red

            options = WordProcessingWatermarkSectionOptions()
            options.name = "Shape 1"
            options.alternative_text = "Company logo watermark"
            options.effects = effects
            watermarker.add(watermark, options)

        watermarker.save("./output.docx")

if __name__ == "__main__":
    add_watermark_with_effects()

document.docx and logo.png are the sample files used in this example. Download document.docx and logo.png.

Binary file (DOCX, 225 KB)

Download full output

For a text watermark, use WordProcessingTextEffects instead — set its line_format (enabled, color, dash style, line style, and weight) and assign it to options.effects. WordProcessingImageEffects also exposes gray_scale and border_line_format.

To work with shapes already present in a document, see Existing objects in word processing document.