Skip to main content

banner

PyPI PyPI - Python Version

Product Page | Docs | Demos | API Reference | Blog | Free Support | Temporary License

GroupDocs.Watermark for Python via .NET is a document-watermarking API for adding, searching, and removing text and image watermarks. Stamp configurable text or image watermarks — with control over position, size, opacity, rotation, alignment, and tiling — then save the result back to the original format; search for and remove existing watermarks (including ones added by other tools) across PDF, Word, Excel, PowerPoint, Visio, email, and image formats through one unified API, with no MS Office or other external software required.

Get Started

pip install groupdocs-watermark-net
from groupdocs.watermark import Watermarker
from groupdocs.watermark.watermarks import TextWatermark, Font

with Watermarker("document.pdf") as watermarker:
    watermark = TextWatermark("CONFIDENTIAL", Font("Arial", 36.0))
    watermark.opacity = 0.5
    watermarker.add(watermark)
    watermarker.save("watermarked.pdf")

How It Works

The package is a self-contained Python wheel that bundles the embedded .NET runtime and every native dependency (SkiaSharp, Aspose.Drawing) needed to load, watermark, render, and save documents. No external software installation is required — just pip install and start watermarking. The wheel works across Python 3.5 – 3.14 on Windows, Linux, and macOS (Intel + Apple Silicon).

Features

  • Text watermarks — configurable font, foreground/background color, opacity, rotation, and alignment.
  • Image watermarks — from a file or an in-memory stream, with scaling, opacity, and positioning.
  • Positioning & sizing — absolute coordinates, horizontal/vertical alignment, margins, scale-to-parent sizing, and rotation.
  • Tiling — repeat a watermark across the page with configurable tile lines and spacing.
  • Search — find existing watermarks by text, image, color, size, or rotation, combined with AND/OR/NOT criteria.
  • Remove — delete found watermarks individually or in batches and save the cleaned document.
  • Document introspection — read format, page count, and per-page dimensions before processing.
  • Previews — render pages to PNG/JPEG/BMP images via a page-stream callback.
  • Cross-Platform — Windows x64/x86, Linux x64, macOS x64/ARM64.

Common Tasks

  • Stamp a "CONFIDENTIAL" text watermark across every page of a PDF and save it back
  • Add a semi-transparent logo image watermark to a Word or PowerPoint document
  • Tile a watermark diagonally across a page
  • Search a document for an existing watermark by its text and remove it
  • Read a document's format and page count before processing
  • Render watermarked pages to images for a preview UI

Supported File Formats

For a complete list, see supported formats.

Category Formats
Word Processing DOC, DOCX, DOCM, DOT, DOTX, RTF, ODT, OTT
Spreadsheets XLS, XLSX, XLSM, XLSB, ODS
Presentations PPT, PPTX, PPTM, PPS, PPSX, ODP
Fixed-Layout PDF
Diagrams VSD, VSDX, VSS, VST, VDX
Email MSG, EML, EMLX
Images BMP, JPG, JPEG, PNG, GIF, TIFF, WEBP

Examples

Add a text watermark

from groupdocs.watermark import Watermarker
from groupdocs.watermark.watermarks import TextWatermark, Font, Color

with Watermarker("document.pdf") as watermarker:
    watermark = TextWatermark("CONFIDENTIAL", Font("Arial", 48))
    watermark.foreground_color = Color.red
    watermark.opacity = 0.5
    watermark.rotate_angle = -45
    watermarker.add(watermark)
    watermarker.save("watermarked.pdf")

Add an image watermark

from groupdocs.watermark import Watermarker
from groupdocs.watermark.watermarks import ImageWatermark, SizingType

with Watermarker("document.docx") as watermarker:
    watermark = ImageWatermark("logo.png")
    watermark.sizing_type = SizingType.SCALE_TO_PARENT_DIMENSIONS
    watermark.scale_factor = 0.5
    watermark.opacity = 0.7
    watermarker.add(watermark)
    watermarker.save("watermarked.docx")

Tile a watermark across the page

from groupdocs.watermark import Watermarker
from groupdocs.watermark.watermarks import TextWatermark, Font, TileOptions, TileType

with Watermarker("document.pdf") as watermarker:
    watermark = TextWatermark("DRAFT", Font("Arial", 19))
    tile = TileOptions()
    tile.tile_type = TileType.STRAIGHT           # repeat across the page
    watermark.tile_options = tile
    watermark.opacity = 0.3
    watermarker.add(watermark)
    watermarker.save("tiled.pdf")

Search for and remove a watermark

from groupdocs.watermark import Watermarker
from groupdocs.watermark.search.search_criteria import TextSearchCriteria

with Watermarker("watermarked.pdf") as watermarker:
    criteria = TextSearchCriteria("CONFIDENTIAL")     # also: ImageSearchCriteria(...)
    possible = watermarker.search(criteria)
    print("found:", len(possible))
    for wm in possible:
        print(wm.text, wm.x, wm.y)
    watermarker.remove(possible)                       # remove the whole collection
    watermarker.save("clean.pdf")

Read document info

from groupdocs.watermark import Watermarker

with Watermarker("document.pdf") as watermarker:
    info = watermarker.get_document_info()
    print("format:", info.file_type)
    print("pages:", info.page_count)

Watermark from / to a binary stream

import io
from groupdocs.watermark import Watermarker
from groupdocs.watermark.watermarks import TextWatermark, Font

with open("document.pdf", "rb") as src:
    with Watermarker(src) as watermarker:
        watermarker.add(TextWatermark("CONFIDENTIAL", Font("Arial", 36)))
        buffer = io.BytesIO()
        watermarker.save(buffer)          # BytesIO is updated after save
        data = buffer.getvalue()

AI Agent & LLM Friendly

This package is designed for seamless integration with AI agents, LLMs, and automated code generation tools.

  • AGENTS.md in the package — AI coding assistants (Claude Code, Cursor, GitHub Copilot) auto-discover the API surface, usage patterns, and troubleshooting tips from the installed package
  • MCP server — connect your AI tool to GroupDocs documentation for on-demand API lookups:
    { "mcpServers": { "groupdocs-docs": { "url": "https://docs.groupdocs.com/mcp" } } }
    
  • Machine-readable docs — full documentation available as plain text for RAG and LLM context:
    • Single file: https://docs.groupdocs.com/watermark/python-net/llms-full.txt
    • Per page: append .md to any docs URL

Evaluation Mode

The API works without a license in evaluation mode, with these limitations:

  • Output is restricted: PDF output carries an evaluation watermark and other formats show an equivalent evaluation mark.
  • A page/document-count cap applies to processed documents.

To remove these limitations, apply a license or request a temporary license:

from groupdocs.watermark import License
License().set_license("path/to/license.lic")

Or set the environment variable (auto-applied at import):

export GROUPDOCS_LIC_PATH="path/to/license.lic"

Troubleshooting

Issue Platform Fix
Evaluation watermark on output All Apply a license — License().set_license(...) or set GROUPDOCS_LIC_PATH
System.Drawing.Common is not supported Linux/macOS apt-get install libgdiplus (Linux) or brew install mono-libgdiplus (macOS)
The type initializer for 'Gdip' threw an exception macOS brew install mono-libgdiplus
Garbled text / missing fonts in output Linux apt-get install ttf-mscorefonts-installer fontconfig && fc-cache -f
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT errors Linux Do NOT set this variable. ICU must be available.

System Requirements

  • Python 3.5 - 3.14
  • Windows x64/x86, Linux x64, macOS x64/ARM64
  • No additional software required

More Resources

Also available for other platforms: .NET | Java | Node.js


Product Page | Docs | Demos | API Reference | Blog | Free Support | Temporary License

Metadata

Release files for groupdocs-watermark-net 26.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for groupdocs-watermark-net 26.6.0
File
groupdocs_watermark_net-26.6.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
groupdocs_watermark_net-26.6.0-py3-none-manylinux1_x86_64.whl Python 3 none Linux glibc 2.5+ x86-64 Details
groupdocs_watermark_net-26.6.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
groupdocs_watermark_net-26.6.0-py3-none-macosx_10_14_x86_64.whl Python 3 none macOS 10.14+ x86-64 Details

Total release size: 537.2 MB

Release files / groupdocs_watermark_net-26.6.0-py3-none-win_amd64.whl

Download URL groupdocs_watermark_net-26.6.0-py3-none-win_amd64.whl
Size 134.4 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
f6bc02e8ca7c7ddc268ad9b84131f3f580ed19625fd2b609c1bba38fc0630b60
BLAKE2b-256 checksum
How to use checksums
9d02dc7ccf8bd7b056e4bc6db29ac95c57c64b5cb9fa4a9fcf54600749dba177
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / groupdocs_watermark_net-26.6.0-py3-none-manylinux1_x86_64.whl

Download URL groupdocs_watermark_net-26.6.0-py3-none-manylinux1_x86_64.whl
Size 133.7 MB
Tags Linux glibc 2.5+ x86-64 Python 3
SHA-256 checksum
How to use checksums
0384e897c3f9992dc174e8dc6254ec8ffedc35861fc7fb1b70bb9caae0d0a5fc
BLAKE2b-256 checksum
How to use checksums
f5435320ea6ddf60b5615f1dccbd3d9d8bd9a17713a3943d28142b2285ba4f38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / groupdocs_watermark_net-26.6.0-py3-none-macosx_11_0_arm64.whl

Download URL groupdocs_watermark_net-26.6.0-py3-none-macosx_11_0_arm64.whl
Size 133.5 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
cf0eb88e6562b155e6427a42fdd8ef845f63ef68e2b92cd950f35549cd75f773
BLAKE2b-256 checksum
How to use checksums
94538988ec06b8b7b2654543cf7f6a3a69fcd487ee42c68537cc5bd3b842b8ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / groupdocs_watermark_net-26.6.0-py3-none-macosx_10_14_x86_64.whl

Download URL groupdocs_watermark_net-26.6.0-py3-none-macosx_10_14_x86_64.whl
Size 135.7 MB
Tags Python 3 macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
ad0bc7ca00cbf22c85a33e614b6fc8a5cac7798fadeb5a61ef0aea21331aced0
BLAKE2b-256 checksum
How to use checksums
09ff6f95bf238367c47b54fa2c40eba1a2fc500f65994e237f1800f2eefa5d81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release history Release notifications | RSS feed

This release

26.6.0 This release

4 release files

25.12

5 release files

25.3

4 release files

24.9.1

3 release files

24.9

2 release files

24.5

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page