- width, height = gcx:barcode(type, x, y, module_width, module_height, text [, param])
- width, height = gcx:barcodesize(type, x, y, module_width, module_height, text [, param])
- width, height = gfx.barcodesize(type, x, y, module_width, module_height, text [, param])
SYNOPSIS
DESCRIPTION
The first form draws a barcode onto the graphics context. The barcode can then be printed by using one of the conversion functions like gcx:encode() or gcx:save().
The second and third forms allows calculating the size of a barcode without actually drawing it. (The third form is slightly more efficient and does not require a graphics context, but previous SDK versions had only the second form available.)
type indicates the barcode type to be drawn. The barcodes can be grouped into linear and 2D codes. Click on one of the barcodes listed below to get more information on that code.
Linear barcodes
2D barcodes
RETURN VALUE
EXAMPLE
Assume we have a connection to a THSP ticket printer open and the handle stored in the variable printer. This code will generate a QR-Code and store it inside the printer's image buffer.
Real application code might want to keep the bcbuf buffer around in some long term variable, to avoid having it created and destroyed each time a barcode is printed.