Create Barcode with Black Ice X1 Printer Divers
Version number:

BuyBuy Now DownloadDownload

Content-based barcode printing inserts a barcode in the printed document based on the printed document content. The printed text is parsed using regular expression, and only relevant targeted information is extracted from a given document, such as account number, invoice number, pricing, etc. See the examples below.

Select the Barcode tab (Start > Control Panel > Printers and Devices > right click on the Black Ice Printer Drivers X1 > Printing Preferences > Barcode tab) then configure the value of the printed barcode by Extract Text (Using Regular Expression parser).

Extract Text (or Regular Expression parser)

If the user selects this option, Printer Driver X1 will use the text from the printed page as the value of the barcode. However, to extract specific data only from the printed page to be used as the value of the Barcode, one needs to create a Regular Expression configuration file.

To extract specific data only from the printed page to the barcode, one can use a Regular Expression. Regular Expression is a specific pattern that provides flexible means to "match" (specify and recognize) strings of text, such as words, particular characters or patterns of characters. Common abbreviations for Regular expression include regex and regexp. The location of the regexp.txt and regexpformat.txt sample files are:

On every system, the files are located in the directory pointed to by the %ALLUSERSPROFILE% environment variable.
The environment variable points to the C:\Documents and Settings\All Users directory on old systems, and to C:\ProgramData\ on newer systems.

On old systems (Windows XP Windows Server 2003)
C:\Documents and Settings\All Users\Black Ice Software LLC\regexp.txt
C:\Documents and Settings\All Users\Black Ice Software LLC\regexpformat.txt

On new systems (Windows 11/10/8/7 and Windows Server 2022/2019/2016/2012)
C:\ProgramData\Black Ice Software LLC\regexp.txt
C:\ProgramData\Black Ice Software LLC\regexpformat.txt

The filename and the location can be changed in the Printer Driver X1 .INI file or by clicking the Options button next to the Extract Text (using Regular Expression parser). If the printer driver does not find the regexp.txt file, Printer Driver X1 extracts the whole text from the printed document and uses the printed page text as the value of the barcode.

The regexp.txt must contain the regular expression to extract the data from the printed text. The regexpformat.txt contains the declared values to format the extracted data, by the regular expression, to be encoded into a barcode.

For Example;

One can develop content-based barcode printing with the Black Ice Regular Expression Test utility

For more information about the Regular Expression for Developers, please click on this link.