Web Printer是一款适用于 Windows 的应用程序。允许您根据指定的设置直接从浏览器打印。

如果您想要:

  • • 摆脱浏览器弹出窗口
  • • 快速打印
  • • 在 Windows 启动时自动启动
  • • 不需要额外的许可证
  • • 无限数量的安装
  • • 适用于任何打印机
  • • 通过 html 轻松自定义
  • • 消除选择打印机时出现的管理员错误,此解决方案非常有用

系统要求

  • • 需要 x64 或 x86 架构
  • • Windows 操作系统

轻松集成到网站

<!--Connecting Libraries-->

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="html2canvas.min.js" type="text/javascript"></script> 

<!--Script to communicate with the program-->

<script>
function SendPrintCashReceipt() {					
	html2canvas(document.getElementById("PrintReceiptContent"),		
	{				
		scale: 2,					
		allowTaint: true,
		useCORS: true,
	}).then(function (canvas) {				  
	var imgageData = canvas.toDataURL("image/png");		
	var newData = imgageData.replace(/^data:image\/png/, "data:application/octet-stream");					  
	//Splitting base64 string
	var arr_count = newData.match(/.{1,100000}/g).length; 
	var arr = newData.match(/.{1,100000}/g);					
	SendWebSocket(arr_count);       
		//Sending packages
		$.each(arr,function(index,value){                                
			setTimeout(function(){
				SendWebSocket(value);
			}, 0);
		});
	});
}
function SendWebSocket(value)
{
  var ws = new WebSocket("ws://127.0.0.1:1989/");
	ws.onopen = function () {
	ws.send(value);
  };
  return true; 
}
</script>

<!--HTML markup-->

<div id="PrintReceiptContent">
	<!--Your code-->
</div>

 

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。