Thread: Barcode in PDF
View Single Post
Old 26th August 2017, 10:31
bdittmar's Avatar
bdittmar bdittmar is offline
Join Date: Apr 2002
Location: Germany, 50.584097,8.544078
Posts: 1,660
bdittmar will become famous soon enough
Baan: 2.2/3.1/4c4/LN6.1 FP6/FP9/HiDox - DB: tbase, ms-sql7, oracle10gV1, 11g - OS: HP-UX, W2K3, SLES

function string bc$  (long type, long rows, string barcode, long options)

Use this to create a barcode of the specified type.


long type barcode type, a number in the range 1-1000 for a 1D-barcode and 1001-2000 for a 2D-barcode.
long rows The height of the barcode, as a number of lines.
string barcode The string or data that must be converted to a barcode.
long options Options for the barcode, see below

This function can be used in all script types.

Options for barcodes

1D-Barcode option Description 
BC_AUTOPARITY calculate parity 
BC_TRANSPARENTBACKGRND transparent background 
BC_SHOWLIGHTMARGINS show light margins 
BC_SHOWBEARERS show bearer bars 
BC_EXTENDBEARERS extend bearer bar into light margin 
BC_SHOWTEXT show barcode caption text 
BC_CALCCHECKSUM calculate checksum 
BC_SHOWCHKDIGIT show checksum digit 
BC_FIXEDXUNIT use fixed xunits for barcode width 
BC_EXTRA_FLAG1 barcode specific extra1 flag 
BC_EXTRA_FLAG2 barcode specific extra2 flag 
2D-Barcode option Description 
BC2D_TRANSPARENTBACKGRND transparent background 
BC2D_AZTECFLAG Aztec flag 
BC2D_AZTECMENU Aztec menu option 
BC2D_AZTECRVIDEO Aztec reverse video 
BC2D_DATAMATRIXGS1 Datamatrix GS1 encoding 
BC2D_PDF417TRUNCATE PDF417 truncate 
BC2D_SET_MODE(m) mode, valid range: 0x0 - 0xF 
BC2D_SET_LEVEL(l) security level, valid range: 0x00 - 0x3F 
BC2D_SET_XUNIT(x) set x-unit, valid range: 0x00 - 0xFF 
BC2D_SET_MULYUNIT(m) set y-unit multiplier, valid range: 0x0 - 0xF 
BC2D_SET_COLUMNS(c) set columns, valid range: 0x0 - 0xF 
Multiple options can be combined with bit.or function or with + operator (e.g. if more than 2 options need to be combined). Note that not all options are applicable to all barcodes.

Deprecated variants

string bc$( long type, long rows, string barcode )

string bc$( long type, long rows, string barcode, [long calc_checksum, long show_checkdigits] )


The calc_checksum, show_checkdigits and options arguments are not used on non-Windows platforms.
The 3-argument variant of bc$() has a limitation to the barcode type, which need to be in range of 1-31.
The 3- and 5-argument variant of bc$() has a limitation to the barcode string of 224 bytes.
2D-barcodes are supported on Windows platform only, by BWPrint, starting with portingset 6.1c.09 (BW=B40c.95), 8.5a.02 and 8.5b.
Starting with these BWprint versions: a barcode.pdf file is supplied in the directory where BWprint is installed. This pdf contains information about the capabilities and allowed options for barcodes.
1D-barcode options and 2D-barcode options cannot be mixed and will result in unspecified behavior.
Windows platform/BwPrint
The barcode type points to a barcode type. Check the barcode-1D and/or barcode-2D test in the Help menu of BwPrint for available barcode types. The number of available barcode types depend on the thirdparty software from dlSoft. This software is used to generate the barcode images.

Non-Windows platforms
The barcode type points to a shell script that is used to generate the barcode. This script is printer and customer specific. The script is stored in the $BSE/lib/barcode directory. The script name has the form 'type xx ', where xx gets a leading zero for a barcode type with a value lower than 10. For example 'type02' or 'type100'. The script is called by the printer daemon/filter in the form (quotes are added, to surround the barcode caption): $BSE/lib/barcode/type type 'barcode 'rows.


print bc$( 2, 3, "87291803", bit.or( BC_TRANSPARENTBACKGRND,BC_SHOWTEXT) )
Also have a look at :
and search the forum with >>BARCODE<<, you#ll get a lot of hints !


Last edited by bdittmar : 26th August 2017 at 11:11. Reason: add link
Reply With Quote