SetBarcodeRegExpFormatFile

 

#include “BlackIceDEVMODE.h”

 

BOOL            SetBarcodeRegExpFormatFile (BlackIceDEVMODE* pDevMode, LPCTSTR pValue);

Description

Sets the file and path that contains the regular expression format used for the barcode generation. This file is used for the barcode generation if SetBarcodeValueSource is set to BARCODE_PAGE_CONTENT (1).

If pValue is NULL or too small, the function returns FALSE, and pSize will contain the number of bytes required for storing the filename.

If the regular expression format file is not set or points to a nonexistent file, the whole text of the printed page is used for the barcode generation.

The file must be a UNICODE text file (UTF-16, little-endian with byte-order mark).

 

The file must contains a format string used for setting the barcode value. The file can contain arbitrary text and can refer to part or whole of the regular expression string specified by the SetBarcodeRegExpFile function. “$0” (without quotation marks) refers to the complete text matched by the regular expression. “$1” refers to the text matched by the first sub-expression specified by parentheses in the regular expression.

E.g:

           

Page content:                                   This is an example page text.

           

Regular expression:                        (\b[a-z]+\b) page

“\b” matches a word boundary, the whole expression matches “example page”. A sub-expression is specified using parentheses

           

            Regular expression format:            Barcode $1

            $1 refers to the first sub-expression: “example”

 

            Final barcode value:                        Barcode example

 

For help in using regular expressions, please see the regular expressions page of the RTK manual.

 

Internally, the printer driver uses the Microsoft TR1 regular expression library with the ECMA grammar. For more information please see the following page: http://msdn.microsoft.com/en-us/library/bb982727.aspx

 

Parameters

BlackIceDEVMODE* pDevMode               - pointer to the BlackIceDEVMODE structure.

LPCTSTR pValue                                        - null-terminated string, pointer to the filename and path

Return value

TRUE on success, otherwise FALSE.