I need to print a page that has a background image as a background, a logo on a watermark.
But using window.print () the background does not appear in the frame (unless the user checks "background graphics" on the print page in chrome.
I searched and found a line of code in css that forces the chrome to print the background color, but I do not find the code that forces the image to print.
Page code:
<html lang="pt-BR">
<link href="css/impressao.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/main.js"></script>
</head>
<body>
<script type="text/javascript">
window.print();
window.location.href = '../home.php';
</script>
</body>
</html>
CSS:
body{
background-image: url(../img/MARCA.png);
background-size: 100% 100%;
background-repeat: no-repeat;
background-position: center;
}
Ps. I have synthesized the code only for the part that is relevant to the question, to facilitate understanding.
Can anyone help?