2014-06-08 86 views
0

我想在div内容完成打印时停止打印。问题是,如果内容中的内容很少,则会将该页面的其余部分显示为空白。我希望在内容后切出页面已完成打印。我正在使用收据打印机。在完成打印div内容后停止打印

function Popup(data) 
{ 
    var mywindow = window.open('', 'day', 'height=300,width=400'); 
    mywindow.height 
    mywindow.document.write('<html><head><title>my div</title>'); 
    mywindow.document.write('<link rel="stylesheet" href="style.css" type="text/css" />'); 
    mywindow.document.write('</head><body >'); 
    mywindow.document.write(data); 
    mywindow.document.write('</body></html>'); 

    mywindow.print(); 


    return true; 
} 
+0

下面是解决收据打印机的一个问题 - http://stackoverflow.com/questions/5232531/receipt-printer-print-from-webpage – TimSPQR

回答