Bulk generate barcodes using a Script and displaying the barcodes with LibreOffice Calc

This section illustrates how to bulk generate barcodes using a Linux shell script and LibreOffice Calc to apply a font to display the barcodes.

1. Launch "Terminal" from Ubuntu desktop and enter the following:

    
	cd linuxbarcodefonts/Resource/commandline		
		


2. Besides "barcodecmd", this folder also contains "barcodescript.sh" (a shell script), and "barcodedata.txt" (a text file that contains all the input data to be encoded as barcodes). Edit "barcode.txt" to include all the input data you require by using your favorite text editor such as "vi", "pico" or others. An example of the file is shown below.

    
	12345678
	22345678
	32345678
	42345678
	52345678
				


3. When you are ready to generate the barcodes, enter the following:

    
	./barcodescript.sh Code128A barcodedata.txt		
		


The parameters are similar to "barcodecmd", except that the input data parameter has been replaced with a "barcodedata.txt" file. The shell script will loop through each line of the "barcodedata.txt" file and use the "barcodecmd" Font Encoder, described in the previous section, to generate a barcode.

All options supported by "barcodecmd" are also supported by the script. For example, to generate a Code39 barcode with a check character, you can use the following:

    
	./barcodescript.sh Code39 barcodedata.txt 1		
			


4. Next, launch "LibreOffice Calc" from the Ubuntu desktop. Copy all the output generated by the script to the first column of the "LibreOffice Calc" spreadsheet.

5. Select all the cells with the barcode characters output in the spreadsheet and set the Font to "ConnectCode128_S3_Trial" and Font Size to "24". Now, you have a list of Code 128A barcodes generated using fonts.



You can resize the width and height of the cells to ensure that the barcodes are displayed in entirety. Though the Trial fonts contain horizontal demo markings, you can still print the barcodes on your printer and test scan these barcodes.




Linux Barcode Fonts