2

Using ZXing (on Android), if you initiate a PDF417 barcode scan like this...

List<String> oDesiredFormats = Arrays.asList("PDF_417".split(","));
IntentIntegrator integrator = new IntentIntegrator(this);
integrator.initiateScan(oDesiredFormats);

... and you initiate an "all codes" (except PDF417 and maybe a few others) barcode scan like this...

IntentIntegrator integrator = new IntentIntegrator(this);
integrator.initiateScan();

... then how do you initiate a single barcode scan that will recognise both (all the standard codes, and PDF417)? Thanks in advance!

MindMusic
  • 23
  • 3

1 Answers1

1

If you don't specify it, it will default to scanning for whatever the user has configured. This by default includes most formats but not PDF417. So, I think you'd have to enumerate all the formats here. It's not too hard, but do you really want that? usually you have a use case that is scanning for a few related formats at most.

Sean Owen
  • 66,182
  • 23
  • 141
  • 173
  • Yep, I have no control over what type of barcodes may be scanned in this instance so I've opted for maximum compatibility. However, my customer has requested that in addition to being able to scan "any barcode" they specifically want the ability to scan their PDF417 employee badges. Thanks Sean. – MindMusic Mar 24 '14 at 14:33
  • For the record, I used this: `List oDesiredFormats = Arrays.asList("UPC_A,UPC_E,EAN_13,EAN_8,RSS_14,RSS_EXPANDED,CODE_39,CODE_93,CODE_128,ITF,CODABAR,QR_CODE,DATA_MATRIX,PDF_417".split(","));` `IntentIntegrator integrator = new IntentIntegrator(Globals.g_oActivity);` `integrator.initiateScan(oDesiredFormats);` – MindMusic Mar 25 '14 at 15:12
  • Trivial point: you could also have written `Arrays.asList("UPC_A", "UPC_E", ...)` – Sean Owen Mar 25 '14 at 15:30