我正在使用JS打印页面。 任何人都可以告诉我为什么无论文本大小在屏幕上大小,它都会打印相同大小的文本,大约10px ...
<a id="printPageButton" onclick="printPage();">
<button>Print</button>
</a>
<script type="text/javascript">
function printPage() {
//Get the print button and put it into a variable
var printButton = document.getElementById("printPageButton");
//Set the print button visibility to 'hidden'
printButton.style.visibility = 'hidden';
//Print the page content
window.print()
//Set the print button to 'visible' again
//[Delete this line if you want it to stay hidden after printing]
printButton.style.visibility = 'visible';
}
</script>
感谢