AddWatermarkResult class
Leave feedback
On this page
Represents the result of adding watermarks to a document.
The AddWatermarkResult type exposes the following members:
| Property | Description |
|---|---|
| number_applied_watermarks | The number of applied watermarks. |
| succeeded | The list of newly created watermarks. |
import groupdocs.watermark as gw
import groupdocs.watermark.watermarks as gww
with gw.Watermarker("sample_2_pages.pdf") as watermarker:
font = gww.Font("Arial", 19.0, gww.FontStyle.BOLD | gww.FontStyle.ITALIC)
watermark = gww.TextWatermark("Test watermark", font)
watermark.foreground_color = gww.Color.red
watermark.background_color = gww.Color.blue
watermark.text_alignment = gww.TextAlignment.RIGHT
watermark.opacity = 0.5
result = watermarker.add(watermark)
for item in result.succeeded:
print("WatermarkId:", item.watermark_id)
print("WatermarkType:", item.watermark_type)
print("PageNumber:", item.page_number)
print("WatermarkPosition:", item.watermark_position)
watermarker.save("output.pdf")
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.