function printEPLHTML() {
$("#content").html2canvas({
canvas: hidden_screenshot,
onrendered: function() {printBase64Image($("canvas")[0].toDataURL('image/png'));}
});
}
function printBase64Image(base64data) {
if (qz != null) {
qz.findPrinter("Zebra LP2844");
while (!qz.isDoneFinding()) {} //wait for printer to finish finding
if (qz.getPrinter() == null) { alert("Can't find printer!"); return; }
qz.append("\nN\nq609\nQ203,26\n");
qz.append("B5,26,0,1A,3,7,152,B,\"1234\"\nA310,26,0,3,1,1,N,\"SKU 00000 MFG 0000\"\n");
qz.append("A310,56,0,3,1,1,N,\"QZ PRINT APPLET\"\nA310,86,0,3,1,1,N,\"TEST PRINT SUCCESSFUL\"\n");
qz.append("A310,116,0,3,1,1,N,\"FROM SAMPLE.HTML\"\nA310,146,0,3,1,1,N,\"EDIT SAMPLE.HTML\"\n");
qz.appendImage(base64data, "EPL", 150, 300);
while (!qz.isDoneAppending()) {} //wait for image to download to java
qz.append("\nP1,1\n");
qz.print();
}
monitorPrinting();
}
--
--
To unsubscribe from this group, send email to jzebra-users...@googlegroups.com
http://code.google.com/p/jzebra
---
You received this message because you are subscribed to the Google Groups "jZebra users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jzebra-users...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
The ESCP commands are all we need. The rest of the pixel logic has been coded for b&w. We're obtaining a device soon that supports ESCP.
The black&white pixels are all taken care of (we support bits, hex and inverted) just need to know what command is best to send them to the Epson printers. I'll likely use that first tutorial.
qz.append("B5,26,0,1A,3,7,152, B,\"1234\"\nA310,26,0,3,1,1,N, \"SKU 00000 MFG 0000\"\n");
qz.append("A310,56,0,3,1,1,N,\ "QZ PRINT APPLET\"\nA310,86,0,3,1,1,N,\" TEST PRINT SUCCESSFUL\"\n");
qz.append("A310,116,0,3,1,1,N, \"FROM SAMPLE.HTML\"\nA310,146,0,3,1, 1,N,\"EDIT SAMPLE.HTML\"\n");
qz.appendImage(base64data, "EPL", 150, 300);
while (!qz.isDoneAppending()) {} //wait for image to download to javaqz.append("\nP1,1\n");qz.print();}
monitorPrinting();
}
-Tres
On Tue, Sep 24, 2013 at 5:51 PM, Alexander di Chiara <alexander...@gmail.com> wrote:
Hi Tres, hi everybody,this is Alex, nice to meet you all and thanks for all the suggestion i got from this great group till now.I've parsed almost every post of the last year and i didn't find anything on my actual topic.Sure to have some advice i'll try to simplify below what i am doing.
As the subject, i have 20+ different receipt to print in a vending machine (and that's fixed with linux) and the same to be available on smal PC based kiosks in different shops.Being each one completely different from the others (logos, qr code, barcodes.. etc) it's very hard to approach this with a ESCP straight solution. Tonnes of lines and less compatibility with different printers available to the shops.By now, that's what i've suppose to do in the last 2 days.- Implemented perfectly jZebra --> OT: thanks, sounds great and by the way doesn't blame as much as Tres suggests, dunno why but in my chrome version (which is the same on all the machines) it's always working without additional permission requests.- Port all the tickets in pure and strong typed html5 including assets and no css. Is all about inline styles.- Wrote this couple of functions (which is a replica for all ticket, whenever is gonna work):
var changeWindow = window.open('','','width=2,hei ght=2');
if (printdata.type == 1) { // First type ticketchangeWindow.document.write(su nrise);
var canvas = document.getElementById("hidde ns"); // Set the canvas$(changeWindow.document.body) .html2canvas({ // Raster the canvas
canvas: hiddens,onrendered: function() {setTimeout(function () {changeWindow.close();} , 100);var raster = canvas.toDataURL('image/png'); // Full data:image
var output = raster.replace(/^data:image\/( png|jpg);base64,/, ""); // Just the Base 64 data (see Second Option)
applet.setPaperSize("80mm", "175mm");applet.setAutoSize(true);
applet.setOrientation("portra it");
Bahadir,
Since the OP needs the logo to change frequently, I think the download -each-time is a necessity.
IIRC, the flash process can be done with ESC/P as well.....
-Tres
byte nL = (byte)((int)(getWidth() % 256));
byte nH = (byte)((int)(getWidth()/256));
builder.append(new byte[] {0x1B, 0x2A, 33, nL , nH});
function jzebraDoneAppending() {
if (qz != null) {
// Applet not loaded
alert("Applet not loaded!");
} else if (qz.getException() != null) {
// Some error occured
alert(qz.getException().getLocalizedMessage());
} else {
// Cut the paper
qz.appendHex("x1Dx56x41");
}
}
// Warning, due to re-branding, future versions will deprecate jzebraDoneAppending() (i.e. in favor of "qzDoneAppending()", etc).
// Single density: Default behavior. Image's natural size.
qz.appendImage("/path/to/image", "ESCP", "single");
//or
qz.appendImage("/path/to/image", "ESCP", 32);
// Double density: May make image appear smaller (higher resolution)
qz.appendImage("/path/to/image", "ESCP", "double");
//or
qz.appendImage("/path/to/image", "ESCP", 33);
Hello, my printer is an Epson RAW t90 ESC / POS, try from the application that comes with it and prints normally, this is the error when printing from qz-print, and you try 32, 33, 1, 2, "single" and "double" without any changes. my last options are to try experimenting with earlier versions and putting the paper width settings to see if it helps.
--
--
To unsubscribe from this group, send email to jzebra-users...@googlegroups.com
http://code.google.com/p/jzebra
---
You received this message because you are subscribed to the Google Groups "jZebra users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jzebra-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.