Skip to content Skip to sidebar Skip to footer

How To Repeat Watermark Pic On Every Page Of A Pdf Which Is Transformed From A Html Doc That Includes Several Page-break-before/after?

Recently, I'm generating a big pdf from html/CSS, which includes decades of pages. On every page there needs a wartermark picture as background like follows: My codes are as follo

Solution 1:

Finally, I used a div to wrap the whole content of body, and drew the background watermark picture on this div. It seemed to work with a little defect that watermark picture does not extend to the bottom of the last page(red circled in result pdf picture). Any help to eliminate this defect will be appreciated! Additional codes as follows:

-CSS :

.watermark
  {
    background: #fffurl("watermark.png");
        background-size: 100%;
  }

-HTML:

<divclass="watermark"><divclass="page"><h1>This is Page 1</h1></div><divclass="page"><h1>This is Page 2</h1></div><divclass="page"><h1>This is Page 3</h1></div></div>

And the result pdf: enter image description here

Post a Comment for "How To Repeat Watermark Pic On Every Page Of A Pdf Which Is Transformed From A Html Doc That Includes Several Page-break-before/after?"