Hello, I'm having trouble adding a watermark to a report generated with rotating pdf.
This report has a header, which repeats on all pages and a footer that also repeats on every page, now I want to make it have a watermark on every page of the page, the results that I got so far was:
1) the mark on the printed data, repeating on all pages I tried to use position relative, absolute and fixed, with z-index, but did not work as I would like, part of the report was marked behind and Another part stayed (In Front).
2) the mark below the data repeating on all pages as the result would like, but this only on the first page, on the second page the mark left more printed to the left of the report by repeating part of the image on the right side
.water_mark {
background-image: url(../Images/marca-dagua.png);
background-repeat: repeat-y;
padding-right:5px; background-size: 80% auto;
}
<div class="col-xs-12 no-padding-left water_mark" style="">
<table class="table table-bordered">
</table>
</div>
.water_mark {
background-image: url(../Images/marca-dagua.png);
background-repeat: repeat-y;
padding-right:5px; background-size: 80% auto;
background-position-x: 100px;
}
This is the result code 2.
.water_mark {
background-image: url(../Images/marca-dagua.png);
width: 100%;
height: 1500px; /* TAMANHO DA FOLHA */
Position: absolute;
z-index: -1; /* TENTEI OUTROS Z-INDEX */
}
<div class="water_mark" style="">
</div>
<table class="table table-bordered">
</table>
result code 1.
I believe I have a way to pass the Rotating PDF to a background image, but so far I did not get the result, so I tried to solve it with css.
NOTE: The header and footer are made with the rotary through the property: CustomSwitches as per the following code.
string customSwitches = "--footer-left \"Versão: " + Versao.NumeroVersao + "\" " +
"--footer-center \"Chave de segurança: " + ChaveSeguranca + "\" " +
"--footer-right \"Página: [page] de [toPage]\"" +
" --footer-line --footer-font-size \"7\" " +
" --footer-spacing 5 " +
"--header-html \"" + Url.Action("Header", "PadraoRelatorio", new { area = "", Titulo = "PARA CONSTRUÇÃO" }, "http") + "\" " +
"--header-spacing \"5\" " +
"--header-font-size \"7\"";