marcbachmann / node-html-pdf

This repo isn't maintained anymore as phantomjs got dreprecated a long time ago. Please migrate to headless chrome/puppeteer.
MIT License
3.56k stars 545 forks source link

Watermark for all pages #638

Open ays-code opened 3 years ago

ays-code commented 3 years ago

Hi.

I'm putting a watermark in all pages on the pdf but I can't do it successfully. I've tried on the header and footer but there are some issues and it's not showing correctly because the image is large.

The only way is to put this css on the pageContent section but the image is only showing on the first page.

    #pageContent:after {
      content: "";
      display: block;
      position:fixed;
      bottom:0;
      right:0;
      top:0;
      left:0;
      width: 100%;
      opacity: 0.5;
      background-image: url("file:///path/image.png");
      background-repeat: no-repeat;
      background-position: center top;
      background-size: contain;
    }

Any ideas to show it on the other pages?

Thanks. Edwin.