How to Generate GS1 Data Matrix (EPS or Bitmap)?

The following samples show how to create a GS1 Data Matrix image through command line. The samples don't cover spool filter operation (e.g. for SAP).

Output in EPS format, GS1 Data Matrix marked by FNC1 on the first position, module width (dot size) of 0.508 mm

tbarcode -fPS -oBarcode.eps -b71 --DMformat=1 -eon -m0.508 -d"0112345678901231"

Output in GIF bitmap format, 300 dpi, same settings as above

tbarcode -fIMAGE -iGIF -oBarcode.gif -b71 --DMformat=1 -eon -m0.508 --dpi=300

If you need to fit the module width to the pixel grid exactly, you can use the --optimalwidth parameter

tbarcode -fIMAGE -iGIF -oBarcode.gif -b71 --DMformat=1 -eon -m0.508 --dpi=300
        --optimalwidth -d"0112345678901231"

For label printers with a resolution of 203 dpi (thermo transfer) you should adjust the module width for a 203 dpi grid.

tbarcode -fIMAGE -iGIF -oBarcode.gif -b71 --DMformat=1 -eon -m0.500493 --dpi=203
        --optimalwidth -d"0112345678901231"

The FNC1 field separator (used for variable length fields) is inserted into the data string as \F. Eventually you have to encode it in the command line as \ or \\ (e.g. \\F).

tbarcode -fIMAGE -iGIF -oBarcode.gif -b71 --DMformat=1 -eon -m0.508 --dpi=300
        -d"vvvvvv\Fnnnnnn"  (v… data with variable length - use AI)

For inkjet printers you can reduce the bar width to avoid issues with blurred ink. For 10% reduction of the module width add:

 --reduction=10 --reductionunit=perc

These examples use sample values for data matrix size (module width). Larger barcode symbols are possible and recommended for better readability. Just watch out for the correct settings according to the specifications of your printer (dpi, dot size).

How can I set the PDF417 Row Height?

The following samples show how to create a PDF417 bitmap file with a specific row height. The samples don't cover spool filter operation.

Output in JPG bitmap format, 96 dpi, module width = 1 Pixel, row height = 3 Pixels, data columns = 5

tbarcode -fIMAGE -iJPG -oBarcode.jpg -b55 --dpi=96 -m0.264583 -h20 --PDFcols=5
        --PDFrowheight=0.79375 -d"ABCDEFG1234567890"

Same as above but with reduced row height / module width ratio (2:1).

tbarcode -fIMAGE -iJPG -oBarcode.jpg -b55 --dpi=96 -m0.264583 -h20 --PDFcols=5
        --PDFrowheight=0.52917 -d"ABCDEFG1234567890"
Although not influencing the resulting bar code height, the height parameter must be specified.

Barcodes Shifted Downward (PCL Coordinate System)

The coordinate system with PCL draws from top to bottom, thus from the cursors position downward. If you want to draw from the current cursor position upwards you can adjust this in the tbarcode.conf file.

Insert a new row in the tbarcode.conf file:

# set origin of barcode to left bottom corner of bounding rectangle

Which Bar Code Product is best Suited for my Environment?

TEC-IT offers three different solutions for bar code generation in SAP. Each solution has its special advantages and characteristics.


If your company mainly uses PostScript® compatible printers, then TBarCode/Direct is the best solution. No middleware, central installation, all printers (with PostScript).


This Barcode DLL is recommended for Microsoft® Windows environments in which you can print centrally via a print server with SAPSprint (spooling software of SAP) or on the SAPGUI client (frontend printing). Any printer using Windows drivers can be connected. The Barcode DLL is also the solution of your choice in case of Unicode printing with SWINCF or other CF device types.


TBarCode/X is an all-round barcode software solution for UNIX®, Linux® and Mac OS X® environments. TBarCode/X can be installed into the spool system of a print server (or on the SAP server itself). Suitable for PCL and PostScript® printers. Existing device types for PCL printers can be re-used, no change to Windows drivers required.