0

我正在使用 JS 打印页面。谁能告诉我为什么无论屏幕上的文本大小,无论大小,它总是打印相同大小的文本,大约 10 像素...

<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>

谢谢

4

0 回答 0