Python developers, rejoice! The initial release of GroupDocs.Watermark for Python via .NET 24.5 is now available for Win32 systems. The Python API lets you add text and image watermarks to documents and search existing watermarks to boost the protection and integrity of your documents.
Start Adding Text and Image Watermarks in Python
Inject text and image watermarks into your documents documents with this release of the Python document watermarking API. Use custom text overlays, colors, positioning, and more for an excellent document branding experience on Win32-powered machines.
Add text watermarks to your documents:
with gw.Watermarker(test_files.sample_docx) as watermarker:
font = gww.Font("Arial", 36.0)
watermark = gww.TextWatermark("top secret", font)
watermark.foreground_color = gww.Color.red;
watermark.horizontal_alignment = gwс.HorizontalAlignment.CENTER
watermark.vertical_alignment = gwс.VerticalAlignment.CENTER
watermarker.add(watermark)
watermarker.save(join(output_directory, "result.docx"))
Source*
Add image watermarks to your documents:
with gw.Watermarker(test_files.sample_xlsx) as watermarker:
watermark = gww.ImageWatermark(test_files.LogoPng)
watermark.horizontal_alignment = gwс.HorizontalAlignment.CENTER
watermark.vertical_alignment = gwс.VerticalAlignment.CENTER
watermarker.add(watermark)
watermarker.save(join(output_directory, "result.xlsx"))
Source*
Search Watermark in Python Apps
Easily search existing watermarks in your documents with this feature on Windows 64-bit systems. It makes managing and removing watermarks convenient. Check out how this feature works in the following code example.
with gw.Watermarker(test_files.sample_docx_with_watermarks) as watermarker:
possible_watermarks = watermarker.search()
for possible_watermark in possible_watermarks:
if possible_watermark.image_data is not None:
print(len(possible_watermark.image_data))
print(possible_watermark.text)
print(possible_watermark.x)
print(possible_watermark.y)
print(possible_watermark.rotate_angle)
print(possible_watermark.width)
print(possible_watermark.height)
Source*
You can view the list of all new features, enhancements, and bug fixes introduced in this release by visiting GroupDocs.Watermark for Python via .NET 24.5 Release Notes.