Piccoli fix su ITF 14 in emulazione tastiera

This commit is contained in:
2020-01-17 10:59:58 +01:00
parent bb76065fc9
commit 433f04ba56
3 changed files with 15 additions and 4 deletions

View File

@@ -110,6 +110,15 @@ public class KeyboardEmulatorBarcodeReader implements BarcodeReaderInterface {
} catch (WrongFormatException e) {
return BarcodeType.CODE128;
}
} else if (barcode.length() == 14) {
try {
int checksum = getEanChecksum(barcode);
if (checksum == Integer.parseInt(barcode.substring(13))){
return BarcodeType.INTERLEAVED_2OF5;
}
} catch (WrongFormatException e) {
return BarcodeType.CODE128;
}
}
return BarcodeType.CODE128;
}