I'm sending address data to a zebra label printer from a webpage. Basically each address is in multiple html input fields. On clicking the print button the routine uses a for loop to pickup each input field's data by its ID and send it to the printer using zpl commands. If I send 24 labels it's fine, anything above that only prints out 24 labels. I'm wondering if there's a data or time limit?
Have added an alert instead of sending the data to the printer and get the correct amount of alerts popping up so I know there's nothing wrong with the code
$('#filterlabel').click(function() {
var ttllabels = $('#ttllabels').html();
if (confirm("Print " + ttllabels + " address labels?") == true) {
var i;
for (i = 0; i < ttllabels; i++) {
var accdelno = $("#accdelno-" + i).val();
var custname = $("#custname-" + i).val();
var address1 = $("#address1-" + i).val();
var postcode = $("#postcode-" + i).val();
var y = 24;
var qty = 1;
var zpl = "^XA";
/* if (contact.length > 0) {zpl = zpl + "^FS^FO20,"+y+"^A0N,36,36^FDATTN: " + contact;y = y + 40;} */
if (custname.length > 0) {
zpl = zpl + "^FS^FO20," + y + "^A0N,36,36^FD" + custname;
y = y + 40;
}
if (address1.length > 0) {
zpl = zpl + "^FS^FO20," + y + "^A0N,36,36^FD" + address1;
y = y + 40;
}
if (postcode.length > 0) {
zpl = zpl + "^FS^FO20," + y + "^A0N,36,36^FD" + postcode;
y = y + 40;
}
zpl = zpl + "^PQ" + qty + "^XZ";
var zebraPrinterUrl = "http://192.168.88.202/pstprnt";
var request = new XMLHttpRequest();
request.open("POST", zebraPrinterUrl, true);
request.setRequestHeader("Content-Length", zpl.length);
request.send(zpl);
}
} else {
return false;
}
});
Only produces 24 labels each time
If I send 10 , I get 10
If I send 36 , I get 24
If I send 25 , I get 24