Barcode Command Line Parameters

Barcode supports fully functional command line execution. Using command line parameters you can generate barcodes of any complexity and save them to vector or raster files.

Command line usage

Here’s how to use Barcode on Windows:

"C:\Program Files\Appsforlife\Barcode\Barcode.exe" --parameter1=value1 --parameter2=value2

And here’s how to use it on Mac OS X:

/Applications/Barcode.app/Contents/MacOS/Barcode --parameter1=value1 --parameter2=value2

So it is pretty much the same, just the matter of where the application is located.

Command line parameters

  • –symbology - a barcode type. Could be one of: EAN-8, EAN-13, ISBN-13, UPC-E, UPC-A, CODE-39, PHARMACODE, DATAMATRIX, PDF-417 or QR-Code
  • –data - main barcode data content (numbers for most of the codes, text for PDF-417, CODE-39, Data Matrix, QR-code)
  • –addon - addon barcode text (2 or 5 numbers for EAN-13, UPC-A or ISBN-13)
  • –adjustment - bar width adjustment in dots, default is 0
  • –scale - barcode scale factor, default is 1.0
  • –dpi - dpi value for saving raster images
  • –output - path and name of the saved file: PNG, TIFF or EPS.

ISBN-related parameters

  • –isbn-prefix - prefix: either “978” or “979”
  • –isbn-price - price, exactly as defined in the user interface.
  • –isbn-country - either “USA”, “UK”, “AUSTRALIA”, “CANADA”, “NZ”, “CUSTOM” or “NONE”
  • –isbn-text-mask - a format string for the ISBN text. Should look like “something [ISBN]”, Barcode replaces “[ISBN]” text with a real ISBN number.
  • –isbn-text-format - a string like “###-#-####-####-#” which Barcode uses to format the ISBN number.

Batch generation parameters

  • –source - defines the text file with barcodes to generate in batch mode
  • –batch-output-separate - if specified, barcodes are exported one per file, otherwise all the barcodes are exported to a single PDF file

Other parameters

  • –code128-type - a type of code-128 barcode: either “A”, “B”, “C” or “Auto”
  • –check-digit - controls whether to add an optional crc-check digit or not (if supported). Use “yes”, “true” or “1” to add, or “no”, “false” or “0” to not add the digit.

Configuring custom texts

You can override custom texts using the “–custom-texts” option. Separate texts with semicolons, use empty blocks to keep the original value. For instance if you create three custom text blocks in the user interface with texts “barcode”, “software” and “rocks” and then run the application this way:

Barcode .... --custom-texts="Barcode;;is amazing"

Barcode will replace the first custom text with “Barcode”, leaves the second one as is, and replace the last one with “is amazing”. Use a single space character if you want to remove the pre-defined text:

Barcode .... --custom-texts="; ;is amazing"

This way Barcode leaves the first text as is, hides the second and replaces the last one with “is amazing”.

If you want to add a semicolon symbol to the text, you need to put a backslash before it. The same for the backslash itself:

Barcode .... --custom-texts="Barcode\; Boxshot;;are amazing\\cool"

In this case the first text becomes “Barcode; Boxshot”, the second is left intact and the last one becomes “are amazing\cool”.

Notes

  • symbology parameters are mandatory
  • if the output parameter is specified, the user interface doesn’t appear, and the barcode is saved into the “output” file
  • otherwise the Barcode UI appears and switches to the specified symbology

Here you can find some command line execution examples.