Search code examples
androidbarcodezxing

ZXing not reading Brazilian Barcode bills (interleaved 2 of 5) correctly. How can I fix it?


I am using XZing 2.3.0 for reading ITF barcodes, but ZXing doesn't read correctly Brazilian Bills with 47 digits.

The following sample barcode image (available here) is been read as 033915959002000008009557735480001438148929501028 instead of 03399557345480001431548929501020159590000000800.

A sample PDF (for printing) is available here. The barcode sequence number is on the top of the bill (a long sequence of numbers separeted by point and space).

I already tried the following code (but with no success):

Intent intent = new Intent("com.google.zxing.client.android.SCAN"); intent.putExtra("SCAN_FORMATS", "AZTEC,CODABAR,CODE_39,CODE_93,CODE_128,DATA_MATRIX,EAN_8,EAN_13,ITF,MAXICODE,PDF_417,QR_CODE,RSS_14,RSS_EXPANDED,UPC_A,UPC_E,UPC_EAN_EXTENSION"); intent.putExtra("SCAN_MODE", Intents.Scan.ONE_D_MODE); intent.putExtra("ALLOWED_LENGTHS", new int[] { 48, 44, 47, 24, 20, 18, 16, 14, 12, 10, 8, 6 });

How can I make ZXing read that barcode correctly?

Thanks for your help guys, and let me know if I can clarify anything else.


Solution

  • Resolved! ZXing is reading right. The problem is the brazilian pattern, because the fields are disposed in a different order from the displayed at the top of the bill. That's crazy!