ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

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
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
The use of bar codes to identify and manage products has become essential.
The principle of bar codes is straightforward: several vertical or square strips of different size and width are 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 found on the supermarket products (USA).
  • EAN (European Article Numbering system): European extension of the UPC code.
  • INTER2OF5: Bar code used in the industrial area.
  • CODABAR: Bar code used in book stores, blood banks.
  • MSI code: Coding performed bit by bit, each bit being the combination of a solid bar and an empty bar.
  • Code 39: First alphanumeric bar code developed.
  • Code 128: Alphanumeric code with high density.
  • DataMatrix code: Bar code in 2 dimensions, used to code of a lot of information on a small surface. This type of bar code is used for the electronic components for example.
  • 417 PDF code: Bar code in 2 dimensions. This type of bar code can support up to 2000 characters. This type of bar code is used in health care, transportation, ...
  • QR Code: Bar code in 2 dimensions. 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.
  • Aztec code: Bar code in 2 dimensions. This type of bar code is mainly used for the dematerialized train tickets.
  • MaxiCode: Bar code in 2 dimensions. 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. It accepts characters in addition to digits: "$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 of 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:
  • Bar codes with check: the last character of the bar code corresponds to a control character.
  • Extended bar code: an extended bar code can contain the 128 characters found in 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:
  • Bar codes with check: the last character of the bar code corresponds to a control character.
  • Extended bar code: an extended bar code can contain the 128 characters found in the ASCII code.
The * character is reserved for START and STOP: it cannot be used in the code (except if the bar code 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 a FNC1 character before the "CODE <128>" string: "<FNC1>CODE <<128>"
The values specified between < > are encoded as they are (regardless of the selected set of characters).
Example: WLanguage code used to print the following EAN128 bar code: (01)93067280205495(3103)018750
iDestination(iViewer, i100)
iPrintBarCode("01<FNC1>93067280205495<FNC1>3103018750", ...
BC_EAN128, 20, 20, 90, 90, BC_ControlDigits)
iEndPrinting
Remark: The brackets are not printed but they are used to separate the data in the text intended to be read by a human being. 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 set of characters at the beginning of the bar code: <START A>, <START B>, <START C>. If no START is specified, the "CODE A" set is used by default.
  • to change the set of characters in the bar code: <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 used to print a bar code with the following characteristics: the first 3 alphanumeric characters must be in set B and the last 10 ones 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.
  • The control characters: The following control characters are accepted: <FNC1>, <NUL>, <PAD>, <STRUCTURED APPEND>, <READER PROGRAMMING>, <05 MACRO>, <06 MACRO>, <ECI>.
  • Set of characters: The choice of the set of characters is optimized in order to write the smallest possible bar code.
    The following control characters enable you to specify the set of characters that will 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
    • from 161 to 320 characters: level 4
    • from 321 characters: level 5
  • Line height: 4 by default
  • Control characters: The accepted control characters are <NUL> and <READER INIT>.
  • Set of characters: By default, the choice of the set of characters is optimized in order to write the smallest possible bar code.
    The following control characters enable you to specify the set of characters that will be used: <TC ALPHA>, <TC LOWER>, <TC MIXED>, <TC PUNCTUATION>, <BC>, <NC>.
Example: WLanguage code used to print a PDF 147 bar code by specifying the set of characters:
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 the QR codes, you also have the ability to specify a correction level for the error: if the code is damaged, up to 30% of the encoded words can be restored. The correction levels are as follows:
  • Level L: about 7% of encoded words can be restored.
  • Level M: about 15% of encoded words can be restored.
  • Level Q: about 25% of encoded words can be restored.
  • Level H: about 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>
Remark: To use the '<' and'>' characters, they must be typed twice.
Caution: This bar code cannot be decoded on the screen. It must be printed.
Related Examples:
WD Reports Training (WINDEV): WD Reports
[ + ] This example presents the different methods for creating a report:

- prints based on different data sources (queries, variables, ...)
- prints based on controls (Table, Spreadsheet, PVT, ...)
- printing composite reports
- specific prints (portrait/landscape, report with watermark, report with bar code, ...)
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: 07/05/2023

Send a report | Local help