使用JavaScript调用本地打印机
https://blog.csdn.net/zZZxiaozhi/article/details/117062010
# HTML代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<p id="xz">This is Printer!</p>
<button onclick="printer()">打印</button>
</body>
</html>
# js代码
function printer(){
var newWin = window.open('printer', '', '');
var xiaozhi = document.getElementById("xz").innerText; // 这里的id是要打印的标签里的id
// innerHtml .innerHTML
newWin.document.write(xiaozhi);
newWin.document.location.reload();
newWin.print();
newWin.close();
}
其他参考print 文件
https://blog.csdn.net/m0_72416767/article/details/127525980
择善人而交,择善书而读,择善言而听,择善行而从。