Forum How do I...?

Watermark with rotation and opacity

Combeenation
Hi all,

I'm trying to add a watermark to my PDF using Prince XML, with both rotation and opacity applied. However, neither the rotation (transform: rotate(-45deg)) nor the opacity (opacity: 0.2) seem to have any effect. Here is my code:

<!DOCTYPE html>
<html>
<head>
  <style>
    @page {
      @prince-overlay {
        content: "DRAFT";
        font-family: Verdana, Arial, sans-serif;
        font-size: 100pt;
        color: #C8C8C8;
        transform: rotate(-45deg);
        transform-origin: 100% 0;
        opacity: 0.2;
      }
    }
  </style>
</head>
<body>
  <h1 style="color: #1C0264">Hello EuroPDF!</h1>
  <p style="break-before: page">This is on the second page.</p>
</body>
</html>


For opacity, I’m aware of the workaround of using rgba() for the color, but I haven’t found any way to get the rotation working inside @prince-overlay.

According to the reference those properties should be supported: https://www.princexml.com/doc/css-props/

But I have found other posts with similar problems: https://www.princexml.com/forum/topic/4066/overlay-opacity-not-working

Thanks in advance for your help!