getPattern()

The getPattern function may be used by developers who wish to draw bars rather than use the font characters to generate a barcode.

Declaration

Int getPattern(char * szPattern, int isteer)

Isteer – is an integer that determines whether the pattern string is copied to the szPattern buffer or the length of the pattern string is returned.

szPattern is a string buffer that will receive the pattern string.

If isteer is 1 the a pattern string is not copied, but the length of the pattern string is returned by the call (including the space required for the terminating null). If there is no current pattern string (which is the case when an error has occurred) the function returns 0.

If isteer is 0 then the pattern string is copied to the buffer pointed to by szPattern. The buffer must exist and be large enough to receive the complete string, otherwise a memory overwrite will occur. The function returns the length of the string, including the terminating null.

Note that the pattern string is only created when a successful call to barcode() has returned.

For Aztec, DataMatrix and QR Code symbols, a pattern string consists of a sequence of 0s and 1s – 0s for spaces and 1s for bars. In 2D barcodes each line of bars is terminated by a linefeed character <10>

For PDF417 and MicroPDF417 symbols the pattern string consists of a series of digits representing alternately the width of bars and spaces. Again each line of the symbol is terminated by a linefeed character <10>.

 

More:

setSerial()