Command line examples
Basic barcode reading from a file
Read code39 barcode. Output is the default JSON format:
BarcodeReaderCLI -type=code39 "your_file.tif"
Read code39 barcode. Output just text value to the console:
BarcodeReaderCLI -type=code39 "your_file.tif" -format=text --output-text="{text}"
Read barcodes from Web-based images using URL
Read barcodes from Web-based images. Read from multiple images with a single call, each reading a different barcode type.
BarcodeReaderCLI -type=pdf417 "https://your_site/your_file.jpg" -type=code39 "https://your_side/your_file.pdf"
Specify options and sources in a configuration file
BarcodeReaderCLI @"brcli-example.config"
Read Driver's License barcodes
BarcodeReaderCLI -type=drvlic "your_file.pdf"
Read barcodes from multiple files in a folder
Read barcodes in a folder and sub-folders. Limit file types to BMP and PDF
BarcodeReaderCLI -type=pdf417 -sub -incl="*.bmp *.pdf" "your_folder"
Read barcodes using Targeted Barcode Reader (TBR)
Read using TBR Code 120
BarcodeReaderCLI -type=datamatrix -tbr=120 "your_file.bmp"
Read non-English barcode text values
Processing is configured in encoding.config file. Features in this example
- Read multiple barcode types set in -type= option.
- Output results to multiple files with output= options (JSON, CSV, and TEXT files)
- Output to text files using thetemplate.txt file, configure with -output-text= option.
- Limit type date in the output with -fields= option
- Define macros with -d= option and expanding
- Use -encoding= option to convert barcode values to localized text
BarcodeReaderCLI @"encoding.config" -output=console
# ============ OPTIONS
-type=pdf417,qr,datamatrix
# ============ INPUT
-d="SRCDIR=images/encoding/"
-d="OUTDIR={path.tmp}/brcli/"
"{SRCDIR}QR.UTF8.japanese.プライバシーマーク.png"
# =========== Read language-encoded barcodes
# USE 'encoding' to get UTF8 text
-encoding=CP1256
"{SRCDIR}DM.CP1256.arabic.بساطة لأنه الأل.tif"
-encoding=BIG5
"{SRCDIR}PDF417.big5.Chinese.包含一杯准饮料.bmp"
-encoding=CP1251
"{SRCDIR}PDF417.cp1251.russian.ЙшзщЪфг.bmp"
# ============== Read UTF8-encoded barcodes in various languages
-encoding= # Disable encoding
"{SRCDIR}PDF417.UTF8.pdf"
# ============ OUPUT
# Select fields in output files
-fields=text,type,path,encoding
# Set output files
-output="{OUTDIR}utf8.json"
-output="{OUTDIR}utf8.csv"
# Set format for TEXT output
-output-text="./template.txt"
-output="{OUTDIR}utf8.txt"