Dompdf : Watermark

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • item
    Active Community Member
    • Mar 2017
    • 1476

    Dompdf : Watermark

    I have looked for add watermark.. and find a solution (certainly not best way) but work.
    i have try to make a custom template helper but not luck.

    Add in Pdf Template CSS field :

    PHP Code:
      #watermark {
        position: fixed;
        top: 45%;
        width: 100%;
        text-align: center;
        opacity: .1;
        transform: rotate(45deg);
        transform-origin: 45% 45%;
        z-index: 1;
        font-size: 80;
      }
    Add in any place on Pdf Template content :

    PHP Code:
      <div id="watermark">
        CONFIDENTIAL
      </div> 
    
    if someone can have a more good solution .. hope

    watermark is only printed in first page
    Last edited by item; 05-02-2024, 09:40 PM.
    If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​
  • yuri
    Member
    • Mar 2014
    • 8453

    #2
    Will work if you add the div to the header.

    Click image for larger version

Name:	image.png
Views:	167
Size:	32.2 KB
ID:	105711
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment


    • item
      item commented
      Editing a comment
      Yes, find it too
      and i have make a template helper : he add a div with style :

      {{watermark text='confidentielle'}}
Working...