[NTLUG:Discuss] command line barcode decoding

Preston Hagar prestonh at gmail.com
Fri Aug 17 10:11:47 CDT 2012


On Thu, Aug 16, 2012 at 5:16 PM, Richard <ntlug at rain4us.net> wrote:
> the libdmtx.org project is almost what I am looking for --
>
> man dmtxread   "dmtxread searches the named input FILEs for ECC200 Data
> Matrix barcodes, reads their contents, and writes the decoded messages to
> standard output."
>
> That is exactly the functionality that I want except I need to decode  1D
> barcodes -- specifically Code128
>
> I'm going in circles on Google and Sourceforge.  Maybe my search terms are
> not correct.    Does anyone know of a utility that can be executed in bash
> to read a PDF, and extract the bar code data to STDOUT?
>
>

You might want to look into zbar:

http://zbar.sourceforge.net/

On Ubuntu you can

sudo apt-get install zbar-tools

and it will install a cli utility called zbarimg.  You can then either
just point zbarimg at a directory of PDF files, or write a quick find
command or bash script to go through your directories to run zbarimg
on each pdf file.  I haven't used it for Code128 bar codes and don't
have any samples to try it on, but it lists Code128 in its list of
supported formats:


currently supported symbologies are:
      EAN/UPC (EAN-13, EAN-8, UPC-A, UPC-E, ISBN-10, ISBN-13),
      Code 128, Code 39 and Interleaved 2 of 5

Anyway, it might be worth a shot.

Preston



More information about the Discuss mailing list