我一直在尝试使用使用 Javascript 的 pos 蓝牙打印机使用 ng-repeat 打印特定的 div。
function sendToQuickPrinterChrome(){
var qtylength = document.getElementById("totalQtyLength").outerText;
var objDiv = document.getElementById("div_print").outerText;
var dt = document.getElementById("Date").textContent;
var qty = document.getElementById("totalQty").textContent;
var total = document.getElementById("total").textContent;
var order = document.getElementById("order").textContent;
var orderNo = document.getElementById("orderNo").textContent;
var _orderNo = "<CENTER> <BOLD>" + orderNo.trim() + "<BR>";
var tokenNo = document.getElementById("tokenNo").textContent;
var tokenNoVal = "<CENTER> <BOLD>" + tokenNo + "<BR>";
var orderdet = "<CENTER> <BOLD>" + order;
var a = "<CENTER> <BOLD>" + dt;
var totalVal = "<CENTER> <BOLD>" + total;
var quantity = "<CENTER><BOLD>" + qty.trim();
var objDiv = "<CENTER><Big>Company <BR>" + "<CENTER> <BOLD>Order Summary <BR>" + _orderNo + tokenNoVal + a +"<BR>"+ order + qty.trim() + totalVal;
var textEncoded = encodeURI(objDiv );
window.location.href="intent://"+textEncoded+"#Intent;scheme=quickprinter;package=pe.diegoveloper.printerserverapp;end;";
}
Order 是一个带有产品名称和价格的 div。当要在 POS 收据打印机中打印时,会出现错位。我们正在使用快速打印机 android 应用程序进行打印,因为它是一台旧的 POS 打印机。该应用程序用于平板电脑