GroupDocs.Watermark is a powerful document watermarking API that allows to add image and text watermarks. Additionally, it can search and remove the watermarks which were added to the documents by other third-party software.
Project description
GroupDocs.Watermark for Python via .NET is a powerful document watermarking API.
Behold, the power of GroupDocs.Watermark:
How easy you can add a text watermark to a document:
import groupdocs.watermark as gw
import groupDocs.watermark.watermarks as gwo
# Adding text watermark in the pdf file
with gw.Watermarker("input.pdf") as watermarker:
font = gwo.Font("Arial", 36.0)
watermark = gwo.TextWatermark("top secret", font)
watermark.x = 100.0;
watermark.y = 250.0;
watermarker.add(watermark)
watermarker.save("out.pdf");
GroupDocs.Watermark for Python via .NET allows to add image and text watermarks. Additionally, API can search and remove the watermarks which were already added to the documents by other third-party software.
Beloved Features
GroupDocs.Watermark for Python via .NET empowers you to protect and brand your documents with ease and precision:
- Add text and image watermarks to Word, PDF, Excel, PowerPoint, images, and emails.
- Tiling and repeating watermarks across pages or slides for robust, tamper-resistant protection.
- Add watermarks to Excel worksheets as headers, footers, backgrounds, or over cell ranges.
- Search and remove text and image watermarks from documents, even inside shapes, headers, footers, and nested objects.
- Find watermarks by content or patterns using text search, wildcards, or regular expressions.
- Search watermarks by formatting like font, color, size, opacity, rotation, and layering.
- Apply watermarks to embedded images within Word, Excel, PowerPoint, Visio, and email documents.
- Rasterize PDF documents or pages to flatten content and prevent text extraction.
- Handle PDF and email attachments, including detecting and watermarking nested files.
GroupDocs.Watermark for Python via .NET works on Windows, Linux, and macOS, supporting both 32-bit and 64-bit Python 3.5+ environments.
If you’d like to dive deeper or simply enjoy learning more about watermarking, explore our blog posts.
You can start with this article on tiling watermarks in Python.
Supported File Formats
With GroupDocs.Watermark for Python via .NET, developers and applications can process files of the following categories:
- Fixed Layout: PDF
- Microsoft Word: DOC, DOT, DOCX, DOCM, DOTX, DOTM, RTF
- Microsoft Excel: XLSX, XLSM, XLTM, XLT, XLTX, XLS
- Microsoft PowerPoint: PPTX, PPTM, PPSX, PPSM, POTX, POTM, PPT, PPS
- Microsoft Visio: VSD, VDX, VSDX, VSTX, VSS, VSSX, VSDM, VSSM, VSTM, VTX, VSX
- OpenOffice: ODT
- Email: EML, EMLX, OFT, MSG
- Image: BMP, GIF, JPG/JPEG/JPE, JP2, PNG, TIFF, WEBP
See detailed list of file formats.
Get Started
Ready to try GroupDocs.Watermark for Python via .NET?
Fetch the package and install GroupDocs.Watermark. Run this command: pip install groupdocs-watermark-net
If you already have GroupDocs.Watermark installed and want to get the latest version,
you have to run pip install --upgrade groupdocs-watermark-net instead.
Check out GroupDocs.Watermark for Python for .NET documentation.
Add a Image Watermark to a PDF Document
You may add watermarks to documents or images from local disks, as well as from streams.
import groupdocs.watermark as gw
import groupdocs.watermark.watermarks as gww
import groupdocs.watermark.common as gwс
def run():
with gw.Watermarker("sample.pdf") as watermarker:
watermark = gww.ImageWatermark("logo.png")
watermark.horizontal_alignment = gwс.HorizontalAlignment.CENTER
watermark.vertical_alignment = gwс.VerticalAlignment.CENTER
watermarker.add(watermark)
watermarker.save(join(output_directory, "result.pdf"))
Add a Tiling Watermark to a Document
Apply a text watermark across the whole page in a repeated pattern.
import groupdocs.watermark as gw
import groupdocs.watermark.watermarks as gww
with gw.Watermarker("sample.pdf") as watermarker:
font = gww.Font("Arial", 19.0, gww.FontStyle.BOLD | gww.FontStyle.ITALIC)
watermark = gww.TextWatermark("Watermark", font)
watermark.foreground_color = gww.Color.red
watermark.tile_options = gww.TileOptions()
watermark.tile_options.line_spacing = gww.MeasureValue(gww.TileMeasureType.PERCENT, 12)
watermark.tile_options.watermark_spacing = gww.MeasureValue(gww.TileMeasureType.PERCENT, 10)
watermark.opacity = 0.2
watermark.rotate_angle = -30
watermarker.add(watermark)
watermarker.save("result.pdf")
Remove Watermark from a Document
Search for possible watermarks and remove them from the document.
import groupdocs.watermark as gw
with gw.Watermarker("document.pdf") as watermarker:
possible = watermarker.search()
# Remove watermark at the specified index
possible.remove_at(0)
# Remove a specific watermark instance
if possible.count > 0:
possible.remove(possible[0])
watermarker.save("document.pdf")
Search Watermark in a Document
Use Watermarker.search() to scan a document for objects that can be treated as watermarks. This includes watermarks added by third‑party tools.
import groupdocs.watermark as gw
with gw.Watermarker("document.pdf") as watermarker:
possible = watermarker.search()
for wm in possible:
if wm.image_data is not None:
print(len(wm.image_data))
print("Text", wm.text)
print("X", wm.x)
print("Y", wm.y)
print("RotateAngle", wm.rotate_angle)
print("Width", wm.width)
print("Height", wm.height)
print("PageNumber", wm.page_number)
print("")
GroupDocs.Watermark for Python requires you to use python programming language. For Node.js, Java and .NET languages, we recommend you get GroupDocs.Watermark for Node.js, GroupDocs.Watermark for Java and GroupDocs.Watermark for .NET, respectively.
Product Page | Docs | Demos | API Reference | Blog | Search | Free Support | Temporary License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file groupdocs_watermark_net-25.12-py3-none-win_amd64.whl.
File metadata
- Download URL: groupdocs_watermark_net-25.12-py3-none-win_amd64.whl
- Upload date:
- Size: 133.5 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce73c5700397315d93704bdc2cd2b903f7564e1fcc6b3f6f33f5df53ab748da4
|
|
| MD5 |
943b36bea26cf4036e6475e234a2924a
|
|
| BLAKE2b-256 |
cfbe1570d2b396e83013730303fc34ecb50b4f9d3ec603038845d27b67a118dd
|
File details
Details for the file groupdocs_watermark_net-25.12-py3-none-win32.whl.
File metadata
- Download URL: groupdocs_watermark_net-25.12-py3-none-win32.whl
- Upload date:
- Size: 128.1 MB
- Tags: Python 3, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59915086199e1a962cb433db8eae9624a25089334fb92a8ebb2ad364d78d8fa1
|
|
| MD5 |
d4cdd4891fd8174f09b0a26dd96d719e
|
|
| BLAKE2b-256 |
8ba3e0ab84e4592edf7ca7e5b395a3d66a68a7abb5e4c2a4087c4418d9024fc8
|
File details
Details for the file groupdocs_watermark_net-25.12-py3-none-manylinux1_x86_64.whl.
File metadata
- Download URL: groupdocs_watermark_net-25.12-py3-none-manylinux1_x86_64.whl
- Upload date:
- Size: 143.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d4b67efdfd0a59252ee501dfdd26d964c2f2b7909d25181e2203fcfece20eb7
|
|
| MD5 |
6d480c7b5d5e2ddbe9770ee3f6953ebd
|
|
| BLAKE2b-256 |
67a6040999ec6078363becc3efe4d959d010a9a81e2cc647114dd133d708e796
|
File details
Details for the file groupdocs_watermark_net-25.12-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: groupdocs_watermark_net-25.12-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 137.1 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f63ed6841a79eae35764f79dde35f40079ef398a2ca36f8be8118006951d3a2
|
|
| MD5 |
7075aee31d8ee7706b6683a931d2702d
|
|
| BLAKE2b-256 |
6982952ee7532b18cb9d2509a0e76c68e4e4a5b117dace9b58631c2d3796a932
|
File details
Details for the file groupdocs_watermark_net-25.12-py3-none-macosx_10_14_x86_64.whl.
File metadata
- Download URL: groupdocs_watermark_net-25.12-py3-none-macosx_10_14_x86_64.whl
- Upload date:
- Size: 140.1 MB
- Tags: Python 3, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9df6ec320339f23907f628964f9baee45eb54c1710b483d87ede1996b2567f2
|
|
| MD5 |
fedc9a0ef40842bfb222b877f2619627
|
|
| BLAKE2b-256 |
6506126f570ccd3da3c09e2270a08e57efcb90119e637e8f9de34811995fee88
|