Table of Contents
http://www.gnu.org/software/barcode/
GNU Barcode is a tool to convert text strings to printed bars. It supports a variety of standard codes to represent the textual strings and creates postscript output.
Main features of GNU Barcode:
http://www.cccg.ca/~luc/PSutilities.html
Alessandro Rubini's free GNU Barcode, a full-featured barcode engine including ISBN support. This is free open source code, and by far the best solution for all UNIX users. Postscript file output (the bars are created on the fly, not from fonts).
$ barcode -h barcode: Options: -i <arg> input file (strings to encode), default is stdin -o <arg> output file, default is stdout -b <arg> string to encode (use input file if missing) -e <arg> encoding type (default is best fit for first string) -u <arg> unit ("mm", "in", ...) used to decode -g, -t, -p -g <arg> geometry on the page: [<wid>x<hei>][+<margin>+<margin>] -t <arg> table geometry: <cols>x<lines>[+<margin>+<margin>] -m <arg> internal margin for each item in a table: <xm>[,<ym>] -n "numeric": avoid printing text along with the bars -c no Checksum character, if the chosen encoding allows it -E print one code as eps file (default: multi-page ps) -P create PCL output instead of postscript -p <arg> page size (refer to the man page) Known encodings are (synonyms appear on the same line): "ean", "ean13", "ean-13", "ean8", "ean-8" "upc", "upc-a", "upc-e" "isbn" "39", "code39" "128c", "code128c" "128b", "code128b" "128", "code128" "128raw" "i25", "interleaved 2 of 5" "cbr", "codabar" "msi" "pls", "plessey" "code93", "93"
http://ar.linux.it/software/barcode/barcode.html
The barcode program is a front-end to access some features of the library from the command line. It is able to read user supplied strings from the command line or a data file (standard input by default) and encode all of them.
The Command Line
barcode accepts the following options:
` <xmargin> `
<ymargin>]" (with no intervening spaces). Unspecified margin values will result in no margin; unspecified size results in default size. The specified values represent print points by default, and can be inches, millimeters or other units according to the -u option or the BARCODE_UNIT environment variable. The argument is used to place the printout code on the page. Note that an additional white margin of 10 points is added to the printout. If the option is unspecified, BARCODE_GEOMETRY is looked up in the environment, if missing a default size and no margin (but the default 10 points) are used.
` <leftmargin> `
<bottommargin> [- <rightmargin> [- <topmargin>]]]" (with no intervening spaces); if missing, the top and right margin will default to be the same as the bottom and left margin. The margins are specified in print points or in the chosen unit (see -u below). If the option is not specified, BARCODE_TABLE is looked up in the environment, otherwise no table is printed and each barcode will get its own page. The size (but not the position) of a barcode item within a table can also be selected using -g (see "geometry" above), without struggling with external and internal margins. I still think management of geometries in a table is suboptimal, but I can't make it better without introducing incompatibilities.
Grand & Toy # 99773,
Label width: 44 mm Label height: 12 mm Horizontal gap between labels 8 mm Vertical gap between labels: 1 mm Top margin: 13 mm Left margin: 8 mm
Should be:
yes 12345 | head -72 | barcode -p 8.5x11in -umm -t 4x18+8+13 -g 44x12+8+1 -e CODE39 > test.ps
But in fact:
yes 12345 | head -84 | barcode -p 8.5x11in -umm -t 4x21+0+0-0-12.8 -g 36x12+7+0 -m 5,0 -e CODE39 > test.ps; date '+%H:%M:%S'
$ barcode -umm -p letter -t 4x18+8+13 -g 44x12+8+1 -e CODE39 -b 1234567890 -b 1234567890 -b 1234567890 -b 1234567890 -b 1234567890 -b 1234567890 > test.ps barcode: wrong page size specification "letter" barcode: try "barcode --help"
-p 8.5x11in works.
$ yes 12345 | head -72 | barcode -umm -p 215x279mm -t 4x18+0+12-0-12 -g 32x8.5+7+0 -m 0,0 -e CODE39 > test.ps; lpr test.ps; date '+%H:%M:%S' 15:44:48
# add l/r margin = 8 $ yes 12345 | head -72 | barcode -umm -p 215x279mm -t 4x18+0+12-0-12 -g 32x8.5+7+0 -m 8,0 -e CODE39 > test.ps; lpr test.ps; date '+%H:%M:%S' 16:10:30
$ yes 12345 | head -80 | barcode -p 8.5x11in -umm -t 4x20+8+13 -g 44x12+8+0 -m 5,0 -e CODE39 > test.ps; date '+%H:%M:%S' 09:35:57
$ yes 12345 | head -84 | barcode -p 8.5x11in -umm -t 4x21+8+0-8-12 -g 44x12+8+0 -m 5,0 -e CODE39 > test.ps; date '+%H:%M:%S' 10:37:04
$ yes 12345 | head -84 | barcode -p 8.5x11in -umm -t 4x21+0+0-0-12.8 -g 36x12+7+0 -m 5,0 -e CODE39 > test.ps; date '+%H:%M:%S' 11:18:40
I have to say that I was having a hard time trying to figure how to layout printings with the front-end barcode program. I thought it shouldn't be too hard, but over 50 test pages printed, I am still unable to understand how it works, and still very confused. For example, the following is what I found.
Contradicting to what user manual indicates, changing from '-g 44x12+8+0.8' to '-g 44x10+8+0' will not make labels take up less space vertically, but the total vertical space increases instead.
yes 12345 | head -72 | barcode -p 8.5x11in -umm -t 4x18+8+13 -g 44x10+8+0 -m 5,0 -e CODE39 > test.ps
If all else are the same, changing page-size unit without changing the actual page size still produces different print out. E.g., the following 2 commands print different print outs:
yes 12345 | head -84 | barcode -p 8.5x11in -umm -t 4x21+0+0-0-12.8 -g 36x12+7+0 -m 5,0 -e CODE39 > test.ps yes 12345 | head -84 | barcode -umm -p 215x279 -t 4x21+0+0-0-12.8 -g 36x12+7+0 -m 5,0 -e CODE39 > test.ps
Over 10 hours past (19 hours on wall clock) and over 80 test pages printed, I gave up trying. All my labels are still off the grid, but there is nothing further I can twist. This is the worst program that I ever used. Hope my end user can settle down with such "solution". Else, I'll look for something else.
documented on: 2007.11.01