Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to handle binary data returned from barcode scanner?

I have a 2d barcode scanner (Honeywell Xenon 1900).

Scanning 1D barcodes is easy, as the scanner emulates keyboard events and sends plain text.

But when I scan PDF417 format 2D barcodes, the scanner sends binary data. How can I capture and decode this data? Some of symbols are non-printable, so scanning into a form on a web page wouldn't work.

like image 909
griZZZly8 Avatar asked Aug 29 '12 19:08

griZZZly8


People also ask

Do barcodes use binary?

A UPC barcode encodes each of the twelve digits in binary, with the black bars representing 1s and the white bars representing 0s. Each digit is represented by seven bits, with each bit represented by a “sub-bar” that is either black or white.

What happens after barcode is read?

After capturing the information, barcode scanners link to a host computer or tablet and transmit that information in real-time, without additional human intervention. This helps retailers automate data collection processes and reduce human errors like inventory tracking and processing point of sale transactions.

Can you reverse barcodes?

Is it possible to read inverse barcodes with laser scanners? An inverted barcode is printed using white lines on a black background; basically, the reverse of a standard black-on-white barcode. Laser scanners are NOT able to read inverse barcodes. However, many 2D imaging scanners are able to read them easily.

How does a barcode scanner transmit data?

Barcode scanners capture the reflected light and decode it into a numerical sequence of binary code. Traditionally, barcode scanners use laser or LCD light. By capturing the black and white pattern on a barcode, they process and relay that information back to the POS or computer connected to them.


1 Answers

My solution for this question is using COM-port.

I configure scanner, so it sends data not as keyboard events, but in virtual COM-port. Then I have Java-applet, that listens this port (using RXTX). Then COM-port is not empty, I can get data and parse it.

like image 197
griZZZly8 Avatar answered Oct 19 '22 04:10

griZZZly8