GroupDocs.Watermark for Python via .NET Overview
Leave feedback
On this page
What is GroupDocs.Watermark?
GroupDocs.Watermark for Python via .NET is a native Python library that adds, searches, and removes text and image watermarks across PDF, Word, Excel, PowerPoint, Visio, email, and image formats. It runs entirely on-premise, requires no Microsoft Office installation, and ships as a pre-built wheel for Windows, Linux, and macOS.
Typical uses include:
Document security — stamp every file in a pipeline with a “Confidential” or “Draft” mark that is hard to remove with third-party tools.
Branding — overlay a logo or seal on documents and on the images embedded inside them.
Cleanup and migration — find and remove outdated labels or third-party watermarks before sharing or re-publishing.
Compliance and tamper-resistance — lock watermarks, add print-only PDF annotations, or rasterize pages so the watermark cannot be edited out.
Auditing — search documents for existing watermarks by text, image similarity, or formatting, and report or modify them.
Load input from file-like objects — handy for cloud blobs and HTTP bodies.
On-premise
No cloud calls, no Microsoft Office install, no network traffic.
Quick Example
Add a text watermark to a document and save the result with just a few lines of code:
fromgroupdocs.watermarkimportWatermarkerfromgroupdocs.watermark.watermarksimportTextWatermark,Font,Colordefquick_example():# Open the document, add a text watermark, and save the resultwithWatermarker("./document.docx")aswatermarker:watermark=TextWatermark("CONFIDENTIAL",Font("Arial",36))watermark.foreground_color=Color.redwatermark.opacity=0.5watermarker.add(watermark)watermarker.save("./watermarked.docx")if__name__=="__main__":quick_example()
document.docx is the sample file used in this example. Click here to download it.
For finer control, scale, rotate, and center the watermark:
fromgroupdocs.watermarkimportWatermarkerfromgroupdocs.watermark.watermarksimportTextWatermark,Font,Color,SizingTypefromgroupdocs.watermark.commonimportHorizontalAlignment,VerticalAlignmentdefwatermark_with_options():withWatermarker("./document.docx")aswatermarker:watermark=TextWatermark("CONFIDENTIAL",Font("Arial",36))watermark.foreground_color=Color.redwatermark.opacity=0.5watermark.rotate_angle=45.0# Scale the watermark relative to the page and center itwatermark.sizing_type=SizingType.SCALE_TO_PARENT_DIMENSIONSwatermark.scale_factor=0.8watermark.horizontal_alignment=HorizontalAlignment.CENTERwatermark.vertical_alignment=VerticalAlignment.CENTERwatermarker.add(watermark)watermarker.save("./watermarked.docx")if__name__=="__main__":watermark_with_options()
document.docx is the sample file used in this example. Click here to download it.