WatermarkableImage class
Leave feedback
On this page
Represents an image inside a document.
Learn more: https://docs.groupdocs.com/display/watermarknet/Adding+watermark+to+images+inside+a+document
The WatermarkableImage type exposes the following members:
| Method | Description |
|---|---|
| add | Adds a watermark to this WatermarkableImage. This method assumes that watermark offset and size are measured in pixels (if they are assigned). |
| add_watermark | |
| get_bytes | Gets the image as a byte array. |
| find_images | Finds images according to the specified search criteria. (inherited from ContentPart) |
| find_images_image_search_criteria | (inherited from ContentPart) |
| search | Finds possible watermarks according to the specified search criteria. (inherited from ContentPart) |
| search_search_criteria | (inherited from ContentPart) |
| Property | Description |
|---|---|
| height | The height of this WatermarkableImage in pixels. |
| width | The width of this WatermarkableImage in pixels. |
from groupdocs.watermark import Watermarker, TextWatermark, Font
with Watermarker(r"D:\input.doc") as watermarker:
# Initialize text watermark.
watermark = TextWatermark("DRAFT", Font("Arial", 19))
# Find all images in the document.
images = watermarker.get_images()
# Add watermark to each image.
for img in images:
img.add(watermark)
# Save changes.
watermarker.save(r"D:\output.doc")
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.