Click here to Skip to main content
15,889,992 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using rotativa for generate PDF in MVC.

I want watermark in all pages of PDF but unfortunately I am not achieving this.

I have researched also for rotativa but can't find any proper solution for this. And then I have tried this using CSS.

I have tried this


CSS

CSS
#background {
               position: absolute;
               display: block;
               min-width: 100%;
               opacity: 0.5;
               text-align: center;
               background-color: transparent;
               padding-top:50%;
           }
           #bg-text {
               color: lightgrey;
               font-size: 120px;
               transform: rotate(300deg);
               -webkit-transform: rotate(300deg);
               opacity: 0.9;
               filter: alpha(opacity=50);
               background-color: transparent;
           }


HTML

HTML
<div id="background">
           <p id="bg-text">Draft</p>
       </div>


It's works fine for first page of PDF. And I want this in all pages of PDF.
Please suggest me a proper solution for this problem of watermark.

Any solution will be appreciable using CSS or using rotativa
Posted
Updated 24-Oct-15 0:46am
v2

1 solution

You may specify
CSS
position:fixed;

for element that contains your watermarking text: as result it will be repeated on the every page (this solution should work for all wkhtmltopdf wrappers including Rotativa).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900