bardecode
Overview
bardecode -f image_file [options] [long_options]
Bardecode scans TIF and JPG files for barcodes and prints the results to standard output. The source code for this tool is included with the toolkit.
Options
| -c min_length | Minimum length of barcode |
| -C max_length | Maximum length of barcode |
| -d scan_direction | Scan direction mask 1 = Left to Right, 2 = Top to Bottom 4 = Right to Left and 8 = Bottom to Top. default is 15. The scan direction mask controls the directions in which. the barcode reader will look for a barcode. With this version it it now possible to scan for barcodes in any rotation with one call to the reader. |
| -f image_file | image_file can be of type TIF or JPG. JPG files must use the extension ".jpg" or ".jpeg" |
| -g | Load properties and processing instructions from an XML file and save to an XML or CSV file. Must be used with -x and -X flags. (See Process XML for more details). |
| -i page_index | Page number of image indexed from 1 |
| -j jump | Frequency at which scan lines are sampled, default is 1 |
| -k skew tolerance | 0 = off ranging to 5 = any angle |
| -L oversample_sep | Distance between the line samples when over-sampling is used. Default value is 3. |
| -m | Scan for multiple barcodes |
| -M min_space_width | Minimum allowed size in pixels for a space between bars |
| -n noise_reduction | Noise Reduction level (0 = off, typical value is 20) |
| -N noise_reduction | Advanced Noise Reduction (0 = off, typical value is 20) |
| -o min_occurs | Minimum number of matching scan lines, default 2 |
| -O | Sample the scan lines in blocks of 3 with each line separated by oversample_sep lines (see below). |
| -p pref_occurs | Preferred number of matching scan lines, default 5 |
| -P | Show page numbers |
| -q quiet_size | Number of pixels wide for the quiet zone around bar code |
| -S file_template | Split a multi-page TIF file into smaller TIF files. The first page of each new file will contain a barcode The template must include %d to index the files e.g. file%d.tif. Must be used with -m flag. |
| -t barcode_types | Specifies the types of barcodes to read, barcode_types is one or more of "code39", "code128", "upca", "upce", "ean8", "code25", "ean13" and "codabar" joined together with the | character. |
| -t any | Searches for a barcode of any type. |
| -T color threshold | Set the color threshold. Ranges from 0 to 255. Default is 128. |
| -w | Print TIF Warnings to STDERR |
| -u upper_ratio | Defunct flag |
| -x inputXMLFile | XML input file (see LoadXMLSettings for more details). |
| -X outputFile | Save the results to an XML or CSV file. Can be used with the -g flag to process instructions from an input file and save to an output file. (see SaveResults for more details). |
Long Options
The long options give access to all the features of the toolkit.
Supported long options properties are: AllowDuplicateValues, Code25Checksum, Code25MinOccurrenceLength, Code39Checksum, Code39NeedStartStop, ColorThreshold, ConvertEAN13ToUPCE, ColorThreshold, ConvertEAN13ToUPCE, Debug, Despeckle, Encoding, GammaCorrection, MaxRectOverlap, MedianFilter, MinOccurrence, MinSeparation, MinSpaceBarWidth, MultipleRead, NoiseReduction, , OverSamplingSeparation, PrefOccurrence, QuietZoneSize, PageNo, Pattern, ReadCodabar, ReadCode128, ReadCode25, ReadCode25ni, ReadCode39, ReadEAN8, ReadEAN13, ReadNumeric, ReadPatchCodes, ReadPDF417, ReadShortCode128, ReadUPCA, ReadUPCE, ScanDirection, ShortCode128MinLength, ShowCheckDigit, SkewLineJump, SkewTolerance, TifSplitMode, TifSplitPath , UseOverSampling and WeightLongerBarcodes
Please refer to the product documentation for descriptions and appropriate values.
Examples
Scan for a Code 39 barcode in a portrait orientation image:
bardecode -f file.tif -t code39 -d 5
Using long options:
bardecode -f file.tif --ReadCode39=1 --ScanDirection=5
Scan for a Code 39 barcode in a landscape orientation image:
bardecode -f file.tif -t code39 -d 10
Scan for a Code 128 or UPC-A barcode in an image of poor quality:
bardecode -n 20 -f file.tif -t "code128|upca"
Split a multi-page TIF file into smaller files, each with a barcode on page 1
bardecode -t code39 -m -S output%d.tif -f multipage.tif