Is there a way to scan Code 39 and UPC at the same time without changing the barcode type from the options? I tried adding both of them to active barcodes list. Still without changing the option to UPC or Code 39, it is not scanning
1 Answers
I left you some questions with the details you should have given so people can help you more easily but I'll try to answer what I think that your question is. Not sure.
I think you ask why you need to set the reader engine before reading a barcode. I just read the docs for a minute and it is answered there:
Inside the decoder section:
"The most important property is readers which takes an array of types of barcodes which should be decoded during the session.
(...)
Why are not all types activated by default? Simply because one should explicitly define the set of barcodes for their use-case. More decoders means more possible clashes, or false-positives. One should take care of the order the readers are given, since some might return a value even though it is not the correct type (EAN-13 vs. UPC-A).
The multiple property tells the decoder if it should continue decoding after finding a valid barcode. If multiple is set to true, the results will be returned as an array of result objects. Each object in the array will have a box, and may have a codeResult depending on the success of decoding the individual box."
You need to use a config like this one with several readers:
{
readers: [
'code_39_reader',
'code_39_vin_reader',
'upc_reader',
'upc_e_reader'
]
multiple: false
}

- 2,860
- 2
- 23
- 44
-
@eng I think that if you set "multiple: true" you will get an array with one result per reader so if would get a success at third position that success was with the third configured reader. – aalku Aug 15 '19 at 14:13
-
after I get the value from Dropdownlist , how can i put in the readers? var x = document.getElementById("mySelect").value; document.getElementById("demo").innerHTML = x; – Eng Soon Cheah Aug 21 '19 at 15:00
-
I don't know what you are talking about. Please ask any unrelated question as another question. Try not to mix html problems with barcode library problems. – aalku Aug 21 '19 at 18:27