Možda će nekima izgledati malo ne interesantno, ali svejedno meni se čini da bi moglo većini uštedjeti vremena kada su POS printeri u pitanju…
Primjer u Javi.. radi na svim Epson Esc kompatibilnim printerma novije generacije, kao i bloutooth printerima..
public static void printQR(String data, FindBT bt) {
String[] parts = data.split(";");
String sdtQr, sZki, sJir, sTotal;
sdtQr = parts[0];
sZki = parts[1];
sJir = parts[2];
sTotal = parts[3];
//--
String sQr;
if (sJir.length() == 36) {
sQr = String.format("https://porezna.gov.hr/rn?jir=%s&datv=%s&izn=%s", sJir, sdtQr, sTotal);
}
else {
sQr = String.format("https://porezna.gov.hr/rn?zki=%s&datv=%s&izn=%s", sZki, sdtQr, sTotal);
}
//--
int store_len = sQr.length() + 3;
byte store_pL = (byte) (store_len % 256);
byte store_pH = (byte) (store_len / 256);
// QR Code: Select the model
// Hex 1D 28 6B 04 00 31 41 n1(x32) n2(x00) - size of model
// set n1 [49 x31, model 1] [50 x32, model 2] [51 x33, micro qr code]
//
https://reference.epson-biz.com/modu...content_id=140
//byte[] modeQR = {(byte)0x1d, (byte)0x28, (byte)0x6b, (byte)0x04, (byte)0x00, (byte)0x31, (byte)0x41, (byte)0x32, (byte)0x00};
//byte[] modelQR = new byte[]{29, 40, 107, 4, 0, 49, 65, 50, 0};
// QR Code: Set the size of module
// Hex 1D 28 6B 03 00 31 43 n
// n depends on the printer
//
https://reference.epson-biz.com/modu...content_id=141
//byte[] sizeQR = {(byte)0x1d, (byte)0x28, (byte)0x6b, (byte)0x03, (byte)0x00, (byte)0x31, (byte)0x43, (byte)0x03};
//byte[] sizeQR = new byte[]{29, 40, 107, 3, 0, 49, 67, 3};
// Hex 1D 28 6B 03 00 31 45 n
// Set n for error correction [48 x30 -> 7%] [49 x31-> 15%] [50 x32 -> 25%] [51 x33 -> 30%]
//
https://reference.epson-biz.com/modu...content_id=142
//byte[] errorQR = {(byte)0x1d, (byte)0x28, (byte)0x6b, (byte)0x03, (byte)0x00, (byte)0x31, (byte)0x45, (byte)0x31};
//byte[] errorQR = new byte[]{29, 40, 107, 3, 0, 49, 69, 49};
// QR Code: Store the data in the symbol storage area
// Hex 1D 28 6B pL pH 31 50 30 d1...dk
//
https://reference.epson-biz.com/modu...content_id=143
// 1D 28 6B pL pH cn(49->x31) fn(80->x50) m(48->x30) d1…dk
//byte[] storeQR = {(byte)0x1d, (byte)0x28, (byte)0x6b, store_pL, store_pH, (byte)0x31, (byte)0x50, (byte)0x30};
//byte[] storeQR = new byte[]{29, 40, 107, store_pL, store_pH, 49, 80, 48};
// QR Code: Print the symbol data in the symbol storage area
// Hex 1D 28 6B 03 00 31 51 m
//
https://reference.epson-biz.com/modu...content_id=144
//byte[] printQR = {(byte)0x1d, (byte)0x28, (byte)0x6b, (byte)0x03, (byte)0x00, (byte)0x31, (byte)0x51, (byte)0x30};
byte[] modeQR = new byte[]{29, 40, 107, 4, 0, 49, 65, 50, 0};
byte[] sizeQR = new byte[]{29, 40, 107, 3, 0, 49, 67, 4};
byte[] errorQR = new byte[]{29, 40, 107, 3, 0, 49, 69, 49};
byte[] storeQR = new byte[]{29, 40, 107, store_pL, store_pH, 49, 80, 48};
byte[] printQR = new byte[]{29, 40, 107, 3, 0, 49, 81, 48};
//--
bt.WriteBT(CENTER);
bt.WriteBT(modeQR);
bt.WriteBT(sizeQR);
bt.WriteBT(errorQR);
bt.WriteBT(storeQR);
bt.WriteBT(sQr.getBytes());
bt.WriteBT(printQR);
//--
bt.WriteBT(LEFT);
}
Moj prijedlog je da podijelimo iskustva koji POS printeri po modelima (godina proizvodnje) mogu a koji ne mogu generirati QR kodove iz QR Byte pripremljenih podataka..