fttx / barcode-to-pc-app

Barcode to PC app
https://barcodetopc.com/
GNU General Public License v3.0
176 stars 63 forks source link

Add support for function codes #210

Open fttx opened 4 years ago

fttx commented 4 years ago

Zxing alredy supports FNC1, FNC2, ecc. codes, but they're not passed by the phonegap-barcode-scanner plugin.

See:

Sample barcode: image

Raw value: image

barcodeScanResult.text value: image

Hex: image (read by columns)

There I do not see the FNC1 codes. But if I analyze the frame in hexadecimal after acquisition on our application via Barcode to PC Server:

At the start of the bar code, I see 3 non-printable characters but it does not correspond to ]C1 (hexadecimal B5 C3 F1). In the body of the bar command, I do not see the non-printable character corresponding to the 1D hexadecimal.

fttx commented 1 year ago

Zxing has the ASSUME_GS1 option that enables the FNC characters decoding: https://github.com/zxing/zxing/blob/0cf3b9be71680f50c90a71ca26ce0d33664b0dd6/core/src/main/java/com/google/zxing/oned/Code128Reader.java#L239

Problem is, it supports only few FNC characters. It will output the non printable character using the SCAN_RESULT_BYTES array

fttx commented 1 year ago

To convert the FNC1 characters so that parenthesis are shown around the fields use this template:

GS1 Support.btpt.zip