0
如何將生成的圖像從IE11中的javascript發送到(物理)打印機?如何將生成的圖像從IE11中的JavaScript發送到打印機?
打印命令不起作用。點擊右鍵 - 「另存爲」&「打印目標」變灰,但「打印圖片」可用。我可以從JavaScript調用「打印圖片」嗎?
var data = canvas.toDataURL('image/png');
var image = new Image();
image.src = data;
var mywindow = window.open('', 'my div', 'height=400,width=600');
mywindow.document.write('<html><head><title>Title</title>');
mywindow.document.write('</head><body >');
mywindow.document.write('<img src="' + data + '" />');
mywindow.document.write('</body></html>');
mywindow.print();
我不相信你可以直接用JS。您需要調用window.print()來打開打印對話框,然後才能打印。您可能需要使用服務器端語言進行打印。 – scrappedcola
[使用javascript打印圖像]的可能重複(http://stackoverflow.com/questions/2909033/using-javascript-to-print-images) – scrappedcola