Skip to content

Appendix D: Command Line Parameters

Command-line code generation is available in Barcode Studio Pro. In Barcode Studio, select Help > Command Line Usage to open the built-in command-line reference.

Use BCStudio.exe on Windows. On macOS, run /Applications/BCStudio.app/Contents/MacOS/BCStudio. Enclose executable and file paths in quotation marks when they contain spaces.

Before automating a task, you can select File > Save Settings As... to save the code type and basic settings in a .bc file. Values passed on the command line override the corresponding settings in this file.

Syntax

Generate one code from data passed on the command line:

BCStudio.exe -d=<data> -out=<outputfile>
[[-s=]<settingsfile>] [barcode options] [image options] [remaining options]

Generate one code from a text file:

BCStudio.exe -datafile=<datafile> -out=<outputfile>
[[-s=]<settingsfile>] [barcode options] [image options] [remaining options]

Generate separate files from a data list and an output list:

BCStudio.exe -datalist=<datalistfile> -outlist=<outputlistfile>
[-skipheader=<numlines>] [-multiline] [-parseempty]
[[-s=]<settingsfile>] [barcode options] [image options] [remaining options]

Generate one PDF containing all codes from a data list:

BCStudio.exe -datalist=<datalistfile> -out=<outputfile.pdf>
[-skipheader=<numlines>] [-multiline] [-parseempty]
[[-s=]<settingsfile>] [barcode options] [image options] [remaining options]

Open a settings file in Barcode Studio:

BCStudio.exe <settingsfile>

Open Barcode Studio and apply command-line values:

BCStudio.exe -g [-d=<data> | -datafile=<datafile>]
[[-s=]<settingsfile>] [barcode options]

Show the command-line help:

BCStudio.exe [-? | -help]

Code Generation Arguments

-d=<data>
Pass the code data directly on the command line. Alternative to -datafile and -datalist.
-datafile=<datafile>
Pass code data via a text file. Alternative to -d and -datalist.
-datalist=<datalistfile>
Read multiple data records from a text file. Normally, each line contains one record. Use -multiline when records can contain line breaks.
-out=<outputfile>
Set the output filename. The extension normally determines the image format. With -datalist, the output must be a PDF containing all codes.
-outlist=<outputlistfile>
Read output filenames from a text file. This option requires -datalist. The output list normally contains one filename for every data record. If it contains only one PDF filename, Barcode Studio creates one PDF containing all codes.
-skipheader=<numlines>
Skip the specified number of lines at the beginning of the data list. This option requires -datalist.
-multiline
Allow a quoted data record to continue across line breaks. The record must start and end with a quotation mark. Double quotation marks within the data, for example "", represent one quotation mark. Lines without an opening quotation mark are still treated as individual records.
-parseempty
Keep empty lines as data records when separate output files are generated. When all codes are written to one PDF, all data-list lines are processed even without this option.
[-s=]<settingsfile>
A .bc settings file created by Barcode Studio. Command-line arguments override values in the file. Pass the settings file alone (without -s=) to open Barcode Studio in GUI mode.
-g
Open Barcode Studio in GUI mode while also applying command-line arguments.
-? -help
Show the command-line help.

Barcode Options

[-w=<width> | -m=<modulewidth>] [-h=<height>] [-u=<unit>] [-o] [-rot=<rotation>]
-w=<width>
Set the total code width in the selected unit. The default unit is micrometers. For example, -w=50250 is 50.25 mm when no unit is specified.
-m=<modulewidth>
Set the module width, or narrow bar width, in the selected unit. Use this option instead of -w.
-h=<height>
Set the code height in the selected unit.
-u=<unit>
Select the unit for width, height, and module width: MICM (micrometers), MM (millimeters), MIL (mils), IN (inches), PX (pixels), or PT (points).
-o
Enable Optimize Code Quality. Barcode Studio aligns the module width with the pixel grid at the selected resolution, which generally provides better conditions for reliable scanning of raster output.
-rot=<rotation>
Rotate the code clockwise by 0, 90, 180, or 270 degrees. The default is 0.

Image Options

[-it=<imagetype>] [-cs=<colorspace>] [-op] [-r=<dpi>]
[-colorfg=<color>] [-colorbg=<color>] [-colortxt=<color>]
-it=<imagetype>
Set the image format. Normally, Barcode Studio derives it from the output filename extension. See Appendix C: Image Types for the available formats.
-cs=<colorspace>
Set the color space to RGB, CMYK, or GRAY. This option applies to EPS, AI, and PDF output. If it is omitted, the format's default color space is used.
-op
Enable overprinting for EPS or PDF output.
-r=<dpi>
Set the output resolution in dpi. The default is 600 dpi.

Use -colorfg=<color> to override the foreground color, -colorbg=<color> for the background color, and -colortxt=<color> for the text color.

Use one of the following color definitions with these three parameters:

  • RGB(r,g,b), for example RGB(253,172,83);
  • CMYK(c,m,y,k), for example CMYK(0,0.32,0.67,0.01);
  • SPOT(name:alternative color[:tint]) for a PDF spot color, for example SPOT(PANTONE 14-1050 TCX:RGB(253,172,83):1).

RGB values range from 0 to 255. CMYK values and the optional tint range from 0 to 1. Enclose a complete spot-color definition in quotation marks.

Remaining Options

[-logformat=<logformat>] [-log=<logfile>] [-q] [-fs=<fileseparator>]
  • -logformat=<logformat>: Select TEXT or JSON as the log format. The default is TEXT. This option is relevant only when -log is also specified.
  • -log=<logfile>: Write errors to the specified log file. If this option is omitted, no log file is written.
  • -q: Enable quiet mode and suppress dialogs and other user interaction. Add -log when errors must be written to a file.
  • -fs=<fileseparator>: Define a replacement character for path separators in filenames passed on the command line or read from an output list. This parameter does not separate data records.

Examples

Generate a PNG with data 98765, a size of 50 x 30 mm, and optimized code quality:

BCStudio.exe -d="98765" -out="barcode.png" -w=50 -h=30 -u=MM -o

Use a .bc file to select the code type and its basic settings:

BCStudio.exe -d="123" -out="qr-code.png" -s="qr-code.bc" -w=50 -h=50 -u=MM -o

Generate separate files from a data list. output-files.txt contains one output filename for each record in data.txt:

BCStudio.exe -datalist="data.txt" -outlist="output-files.txt" -s="ean-13.bc" -o

Generate one PDF from a data list:

BCStudio.exe -datalist="data.txt" -out="barcodes.pdf" -s="ean-13.bc" -o

Run without dialogs and write errors to a JSON log file:

BCStudio.exe -d="12345" -out="barcode.png" -q -log="errors.json" -logformat=JSON

Generate a PDF using a spot color for the barcode:

BCStudio.exe -d="12345" -out="barcode.pdf" -colorfg="SPOT(PANTONE 14-1050 TCX:RGB(253,172,83):1)"

Open a settings file in GUI mode:

BCStudio.exe "bcsettings.bc"

Open a settings file in GUI mode with given dimensions (50x30 mm):

BCStudio.exe -g -s="bcsettings.bc" -w=50 -h=30 -u=MM