ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Print functions
  • Overview
  • The bar codes supported by WINDEV, WEBDEV and WINDEV Mobile
  • Supported bar codes
  • UPC bar code (Universal Product Code)
  • EAN bar code (European Article Numbering system)
  • INTER2OF5 bar code
  • CODABAR bar code
  • MSI bar code
  • Code 39 bar code
  • Code 128 bar code
  • DataMatrix bar code
  • PDF 417 bar code
  • QR code
  • Aztec bar code
  • MaxiCode bar code
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Overview
The use of bar codes to identify and manage products has become essential.
The principle of the StrikeOut barcode is simple: a few vertical or square strokes of different sizes and widths can be used to encode a set of information..
The information represented by a bar code is a series of numeric or alphanumeric characters. This information can be completed by characters used to simplify the reading or by control characters.
This information can be read:
  • WINDEV via a dedicated device and retrieved in a WINDEV application.
    For the QR Code bar codes, you also have the ability to read a bar code found in an image.
  • Android via the camera of an Android phone and retrieved in an Android application.
  • iPhone/iPad via the camera of an iPhone or iPad and retrieved in an iOS application. For the QR Code bar codes, you also have the ability to read a bar code found in an image.
These bar codes can be printed from a WINDEV or WINDEV Mobile application or from a WEBDEV site.
WINDEV, WINDEV Mobile and WEBDEV allow you to manage several types of bar codes. All these types can be printed. For more details, see Printing bar codes.
The bar codes supported by WINDEV, WEBDEV and WINDEV Mobile

Supported bar codes

Different types of bar codes are available. Each one is used in a specific field. Let's see the main types of bar codes managed by WINDEV, WINDEV Mobile and WEBDEV:
  • UPC (Universal Product Code): Bar code for products sold in supermarkets (US).
  • EAN (European Article Numbering system): European extension of the UPC code.
  • 2PARMI5: Bar code used in industrial environments.
  • CODABAR: Bar code used in bookstores and blood banks.
  • MSI code: Bit-by-bit coding, each bit being the association of a full strikethrough and an empty strikethrough.
  • Code 39: The first alphanumeric barcode ever developed.
  • Code 128: High-density alphanumeric code.
  • DataMatrix code: 2-dimensional strikethrough bar code, enabling a great deal of information to be encoded on a small surface.. This type of bar code is used for the electronic components for example.
  • PDF Code 417: 2-dimensional strikethrough barcode. This type of bar code can support up to 2000 characters. This type of bar code is used in health care, transportation, ...
  • QR Code: 2-dimensional strikethrough code. This type of bar code is used to store different types of information (Web addresses, text, phone numbers, SMS, ...) and it can be directly used by the cell phones or by the smartphones.
  • Code Aztec: 2-dimensional strikethrough barcode. This type of bar code is mainly used for the dematerialized train tickets.
  • MaxiCode: 2-dimensional strikethrough barcode. This type of bar code is mainly used for the transport (UPS shipping company).
The following paragraphs present these types of bar codes and their characteristics supported by WINDEV, WINDEV Mobile and WEBDEV.

UPC bar code (Universal Product Code)

UPC bar code
Bar code found on the supermarket products (USA). Its overall size is 12 digits. It contains:
  • the supplier code (5 characters).
  • the product code (5 characters).
  • a system number.
  • a control character.

EAN bar code (European Article Numbering system)

EAN13 bar code
EAN 13 code
European extension of the UPC code. Several versions exist:
  • EAN 13, containing the 12 characters of the UPC code, and a parity check number.
  • EAN 8, containing 2 reserved characters, a 5 character code and a control character.
  • EAN 128: see code 128

INTER2OF5 bar code

INTER2OF5 bar code
Bar code used in the industrial areas, compact with a maximum of 18 character by inch. It is mainly used for totally automated reading.

CODABAR bar code

CODABAR bar code
Bar code used in book stores, blood banks. In addition to numbers, it accepts the characters: "$ABCD./+:-".
The string must start and end with a START/STOP character. The START/STOP characters are A, B, C, D. The character A is automatically added if this character is not found in the string.
Example value: "A123456789123456789A"

MSI bar code

MSI bar code
Coding performed bit by bit, each bit being the combination of a solid bar and an empty bar. It accepts 10 digits and 6 additional characters.
Characteristics supported for this bar code:
  • Strikethrough barcode: the last character of the barcode corresponds to a check digit.
  • StrikeOut: an extended barcode can contain all 128 characters of the ASCII code.

Code 39 bar code

Code 39 bar code
First alphanumeric bar code developed. Originally, it accepts the 26 letters of the alphabet in uppercase characters. With extension, the 128 ASCII codes are accessible.
The Code 93 is an extension of code 39.
Characteristics supported for this bar code:
  • Strikethrough barcode: the last character of the barcode corresponds to a check digit.
  • StrikeOut: an extended barcode can contain all 128 characters of the ASCII code.
The * character is reserved for START and STOP: it cannot be used in the code (unless the barcode is extended).

Code 128 bar code

Code 128 bar code
Alphanumeric code with high density.
It uses three different sets of characters. The set of characters used is automatically selected by WINDEV, WEBDEV or WINDEV Mobile to draw the smallest possible bar code.
A correction character is automatically generated. Its value is equal to the weighed sum of the values of characters modulo 103.
Control characters
The following control characters are accepted: <FNC1>, <NUL>, <FNC2>, <FNC3>, <FNC4>, <SHIFT>.
Example: Encoding an FNC1 character before the string "CODE <128>": "<FNC1>CODE <<128>"
The values specified between < > are encoded as they are (regardless of the selected set of characters).
Example: WLanguage code to print the following EAN128 code: (01)93067280205495(3103)018750
iDestination(iViewer, i100)
iPrintBarCode("01<FNC1>93067280205495<FNC1>3103018750", ...
	BC_EAN128, 20, 20, 90, 90, BC_ControlDigits)
iEndPrinting
Note Brackets are not printed but are used as data separators in text intended to be read by a human. The <FNC1> character is used to separate the data in a EAN128 bar code. FNC1 is a control character. To insert it into the string to encode, specify the BC_ControlDigits constant (or "Specify the control characters" in the report editor).
Sets of characters
By default, the set of characters used is automatically selected by WINDEV, WEBDEV or WINDEV Mobile to draw the smallest possible bar code.
The following control characters enable you to specify the set of characters that will be used:
  • to specify the character set at the beginning of the strikethrough: <START A>, <START B>, <START C>. If no START is specified, the "CODE A" set is used by default.
  • to change the strikethrough character set: <CODE A> <CODE B> , <CODE C>.
By default, control characters are enclosed between "<" and ">". To avoid interpreting these characters as control characters, simply double the first "<":
  • "<C40>" = control character
  • "<<AB>" = <AB> to be encoded in the bar code.
Example: WLanguage code for printing a code with the following characteristics: the first 3 alphanumeric characters must be in set B and the last 10 in set C:
iDestination(iViewer, i100)
iPrintBarCode("<START B>ABC<CODE C>0123456789", BC_CODE128, 20, 20, 80, 60, BC_Charsets)
iEndPrinting()

DataMatrix bar code

DataMatrix bar code
Bar code in 2 dimensions, allowing to code up to 2335 alphanumeric characters or 3116 numeric characters on a small surface. This type of bar code is used for the electronic components for example.
Characteristics supported for this bar code:
  • The size of the matrix. By default, the size of the matrix is calculated according the size of the string and it is optimized to get a square matrix.
  • Control characters: The following control characters are accepted: <FNC1>, <NUL>, <PAD>, <STRUCTURED APPEND>, <READER PROGRAMMING>, <05 MACRO>, <06 MACRO>, <ECI>.
  • Character set: The choice of character sets is optimized to write the smallest possible strikethrough barcode..
    To specify the character set to be used, the following control characters can be used: <ASCII>, <C40>, <TEXT>, <X12>, <EDIFACT>, <BASE256>. The default set of characters is "ASCII". This set must be used to specify a value that is already encoded or to specify another set of characters. To go back to the ASCII code from another set of characters, al you have to do is specify <ASCII>.
By default, control characters are enclosed between "<" and ">". To avoid interpreting these characters as control characters, simply double the first "<":
  • "<C40>" = control character
  • "<<AB>" = <AB> to be encoded in the bar code.

PDF 417 bar code

PDF 417 bar code
Bar code in 2 dimensions. This type of bar code can support up to 2000 characters (the one-dimensional bar codes do not support more than 30 characters).
The storage capacity of this type of bar code is very important.
This type of bar code is used in health care, transportation, ...
For the PDF417 bar codes, the following characteristics are also supported:
  • By default, the size of the matrix is calculated according to the size of the string
  • Level of correction calculated according to the length (after compression) of the data to encode:
    • from 1 to 40 characters: level 2
    • from 41 to 160 characters: level 3
    • 161 to 320 characters: level 4
    • from 321 characters: level 5
  • Line height: default 4
  • Control characters: The control characters accepted are <NUL> and <READER INIT>.
  • Character set: By default, the choice of character sets is optimized to write the barcode as small as possible..
    To specify the character set to be used, the following control characters can be used: <TC ALPHA> <TC LOWER> , <TC MIXED>, <TC PUNCTUATION>, <BC>, <NC>.
Example: WLanguage code for printing a PDF 147 code, specifying the character set:
iPreview(i100)
iPrintBarCode("<READER INIT><TC LOWER>abcd<TC MIXED><TC PUNCTUATION>(?)", ...
	BC_PDF417, 0, 0, 200, 200, BC_ControlDigits + BC_Charsets)
iEndPrinting()
By default, control characters are enclosed between "<" and ">". To avoid interpreting these characters as control characters, simply double the first "<":
  • "<C40>" = control character
  • "<<AB>" = <AB> to be encoded in the bar code.

QR code

QR Code
Bar code in 2 dimensions, made of black modules arranged in a square with a white background. This type of bar code is intended to be read by a reader of QR code, a mobile phone or a smartphone. It can support up tp 7089 numeric characters or 4296 alphanumeric characters (the one-dimensional bar codes do not support more than 30 characters).
The storage capacity of this type of bar code is very important.
This type of bar code is used in several fields. It can store Web addresses, text, phone numbers, SMSs, ...
For QRcodes, it is also possible to specify an error correction level: if the code is damaged, up to 30% of the coded words can be restored.. The correction levels are as follows:
  • Level L: around 7% of encoded words can be restored.
  • Level M: around 15% of encoded words can be restored.
  • Level Q: around 25% of encoded words can be restored.
  • Level H: around 30% of encoded words can be restored.

Aztec bar code

Aztec bar code
Bar code in 2 dimensions, made of a central square target. The data is encoded in the concentric layers of pixels around this target. This type of bar code is intended to be read by a bar code reader, a cell phone or a smartphone. It can support up to 3000 ASCII characters.
This type of bar code is mainly used for the dematerialized train tickets.
For the Aztec bar codes, you also have the ability to specify a correction level in percentage, included between 5 and 95%. If the code is damaged, up to 95% of the encoded words can be restored.

MaxiCode bar code

MaxiCode bar code
Bar code in 2 dimensions, made of a central element, similar to a target, surrounded by a square matrix of 33 rows of 29, or possibly 30, hexagonal elements. This type of bar code is intended to be read by a specific bar code reader. The MaxiCode has a fixed size set to 1 inch on 1 inch. It is used to print around 100 alphanumeric characters on its surface of 1 square inch. This type of bar code is used for the transport, the security, the health, and mainly by the UPS company that developed this type of bar code.
This type of bar code proposes different modes. To specify the mode used (2 to 4), all you have to do is use the <MODEx> tag where x corresponds to the number of the requested mode. The mode 2 and 3 corresponds to the specific format used by UPS. The following tags are also supported:
  • <EOT>
  • <GS>
  • <RS>
  • <FS>
Note: To use the '<' et'>' characters, they must be doubled..
Warning: This strikethrough code cannot be decoded on screen.. It must be printed.
Related Examples:
WM Stocks Cross-platform examples (WINDEV Mobile): WM Stocks
[ + ] This application is used to perform stocktaking and to save the results in a database.
The example is used to create entries/exits in the stock, by directly scanning the bar code of products.
It is optimized to be run on tablets.
Android Inventory Android (WINDEV Mobile): Android Inventory
[ + ] This application is used to perform inventories and to save the results in a database.
The Bar Code control Unit examples (WINDEV): The Bar Code control
[ + ] Using a Bar Code control
Minimum version required
  • Version 9
This page is also available for…
Comments
Problemas a decodificar um QR-Code no Telemóvel(Celular)
Ao gerar um QR-Code, se o mesmo tiver dificuldade em ser interpretado, experimente usar este código:

O Decode da imagem teimava em não funcionar no celular. No entanto, se o QRCode, com o mesmo conteúdo, fosse gerado fora do Windev, funcionava TOP.

qr is BarCode
qr..Content = EDT_qr
qr..TypeBarCode = BC_QRCODE
qr..CorrectionError = qrcodeLevelH
qr..ContentType = bcTypeText
(até à V27, apenas funciona no Windev)

Este código desenvolvido pelo Paulo Maia, ao qual agradeço imenso, pois resolveu definitivamente o meu problema
João Ferreira
16 Jan. 2023

Last update: 11/05/2024

Send a report | Local help