__init__ constructor

On this page

init

Initializes a new TextWatermark with the specified text and font.

def __init__(self, text, font):
    ...
Parameter Type Description
text str The text to be used as watermark.
font Font The font of the text.

Example

from groupdocs.watermark import Watermarker
from groupdocs.watermark.watermarks import TextWatermark, Font, Color

with Watermarker("document.pdf") as watermarker:
    watermark = TextWatermark("CONFIDENTIAL", Font("Arial", 48))
    watermark.foreground_color = Color.red
    watermarker.add(watermark)
    watermarker.save("watermarked.pdf")

See Also

On this page