打印与屏幕上不同的文本大小

时间:2013-07-15 14:42:21

标签: javascript jquery text

我正在使用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>

感谢

0 个答案:

没有答案