DEV Community

Atir Tahir
Atir Tahir

Posted on • Edited on

1

Adding text or image watermark programmatically

Have a look at these supported file formats. Yes, you can add watermark (image or text) to all of them programmatically.
Have a look at the following code, it adds a text watermark with a specific font-family and size.

using (Watermarker watermarker = new Watermarker("sample.pdf"))
{
    TextWatermark watermark = new TextWatermark("top secret", new Font("Arial", 36));
    watermark.ForegroundColor = Color.Red;
    watermark.HorizontalAlignment = HorizontalAlignment.Center;
    watermark.VerticalAlignment = VerticalAlignment.Center;
    watermarker.Add(watermark);
    watermarker.Save(Constants.OutDocumentPdf);
}
Enter fullscreen mode Exit fullscreen mode

For further details, please visit this documentation article and in case of any issue, you can post it here.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay