Remova o botão de impressão da cópia impressa
Com referência aesse link eisto, Imprimo um relatório usando javascript como
<!DOCTYPE html>
<html>
<head>
<script>
function printpage()
{
var data = 'Sample Report<br />Sample Report<br />Sample Report<br />';
var data = data+'<br/><button onclick="window.print()">Print the Report</button>';
myWindow=window.open('','','width=800,height=600');
myWindow.innerWidth = screen.width;
myWindow.innerHeight = screen.height;
myWindow.screenX = 0;
myWindow.screenY = 0;
myWindow.document.write(data);
myWindow.focus();
}
</script>
</head>
<body>
<input type="button" value="Print Preview" onclick="printpage()" />
</body>
</html>
Mas após a impressão, o botão de impressão ainda permanece na cópia impressa. Então, como esconder o botão de impressão em cópia impressa ao imprimir usando a função acima?