Need Repetitive Watermark Across the Entire Page (Like Sample Image)

Hi Doconut Team,

I need to add a repetitive watermark across the entire page, similar to the example shown in the attached screenshot:
image.png (68.9 KB)

In our other document viewer, the text 94348392 appears repeatedly all over the page as a watermark. I would like to achieve the same effect in Doconut.

I am currently using the MVC Core Doconut setup.
Could you please guide me on how to implement this?

@Mohit_Tandel

Here’s a detailed explanation to help you configure it correctly:

            var documentOptions = new DocOptions
            {
                Watermark = "^Sample Copy~Red~24~Verdana~50~-45",
            };

            var token = docViewer.OpenDocument(pathToFile, config, documentOptions);

A valid watermark string follows this format:

^Text~Color~FontSize~FontName~Transparency~Rotation

Breakdown of the Structure:

  1. ^ (Optional):
  • The ^ character at the beginning indicates that the watermark should appear in all corners of the image. If this character is omitted, the watermark will be placed only in a single position.
  1. Text (Required):
  • The text you want to display as the watermark. For example, “Test watermark.”
  1. Color (Required):
  • The color of the text, e.g., “Red,” “Blue,” or any valid color name.
  1. FontSize (Required):
  • The size of the font for the watermark text, such as 24.
  1. FontName (Required):
  • The font family name, e.g., “Verdana,” “Arial.”
  1. Transparency (Required):
  • A value from 0 (completely transparent) to 255 (fully opaque) that controls the text’s transparency. For example, 50 for semi-transparency.
  1. Rotation (Required):
  • The angle of rotation for the watermark in degrees. For example, -45 rotates the watermark diagonally.

I hope this clarifies the watermark structure. Please let me know if you need further assistance or examples to implement this in your project.

Hi @gabriel.vega,

Thanks for the reply.

Using ^ adds the watermark in all corners and in the centre — that part is working correctly.

However, could you please clarify whether my requirement is achievable in Doconut? I’d like to confirm whether this specific watermark placement behaviour, as described in my first post, is supported.

Thanks again.

@Mohit_Tandel

Thanks for your message.

To clarify the current capabilities of Doconut’s watermarking system:

  • The watermark engine can place up to five instances of the text:
    the four corners + the center.
  • These are the only supported positions at the moment.
  • If you want the watermark text to appear horizontal, you can set the rotation value to 0 (instead of -45 or any angled orientation).
  • If you want the watermark to visually “repeat” across a wider area, you can manually repeat the text in the watermark string, for example:
    "text sample text sample text sample"
    (adding spaces in between to increase spacing).

More advanced or custom placement patterns (e.g., distributing text multiple times horizontally across the entire page) are not currently supported.

Please let us know if you need any help!