i am using window.print method to print given below screen. Now i want to hide date(top left of image and title(not big heading) which i have blurred for a reason).
I have read articles where it says @pages { margin: 0 }
but i am not sure how to apply that to window.print();
I have tried using setAttribute()
but its not helping or maybe i did some mistake
const element = document.getElementById("qr-code").innerHTML;
var printWindow = window.open('', '', 'height=800,width=800');
printWindow.document.write(element);
printWindow.document.close();
const title = printWindow.document.title = "some title here";
const heading = printWindow.document.createElement('h1');
const text = printWindow.document.createTextNode(title);
heading.appendChild(text);
heading.setAttribute('style', 'order: -1; margin-bottom: 50px;');
printWindow.document.body.appendChild(heading);
printWindow.document.body.setAttribute('style', 'display: grid; width: 100%; justify-items: center; margin: 0;');
printWindow.print();