I need to print a web page on regular A4 page.
The print result should be exactly 20cm x 20cm (no matter it's position on paper).
I have this html page:
body {
-webkit-print-color-adjust: exact;
height: 20cm;
width: 20cm;
margin: 0;
padding: 0
}
img {
height: 20cm;
width: 20cm;
position: absolute;
top: 0;
left: 0;
}
h1 {
font-size: 0.9cm;
position: relative;
top: 1cm;
text-align: center;
width: 70%;
margin: 0 auto;
color: #ffde00;
}
@media print {
body {
height: 20cm;
width: 20cm;
}
}
<img src="background.png">
<h1>My Example Text</h1>
When I am printing this page (on a regular lasterJet A4 printer) I am getting about 18.9cm result on the paper.
How can I make it exactly 20cm ?