|
|
|
|
|
- Properties specific to BarCodes variables
- Correspondence between the Content and ContentType properties
- Functions that use BarCodes variables
BarCodes (Variable type) In french: CodeBarres
The BarCodes type is used to handle the information found in a bar code. You can define and change the characteristics of this barcode using different WLanguage properties. The BarCodes type can be used as follows: - The BarCodes type is mainly used to:
- decode the bar codes read by the device camera.
- generate bar codes in the windows.
- The BarCodes type is mainly used to:
- generate QR Code bar codes in the windows.
- decode the bar codes read by the device camera.
- decode the QR Code bar codes found in an image.
- print the bar codes (iPrintBarCode).
Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
MonQRCode is BarCode
MonQRCode.ContentType = bcTypeText
MonQRCode.TypeBarCode = BC_QRCODE
MonQRCode.Content = "http://www.pcsoft.fr"
CBA_ChampCB = MonQRCode
QRCodeAvecImage is BarCode
ImageCentreQRCode is Image
ImageCentreQRCode = IMG_DRAPEAU
QRCodeAvecImage.TypeBarCode = BC_QRCODE
QRCodeAvecImage.ContentType = bcTypeText
QRCodeAvecImage.Image = ImageCentreQRCode
QRCodeAvecImage.CorrectionError = qrcodeLevelH
QRCodeAvecImage.ImageProportion = 3
QRCodeAvecImage.Content = "https://www.pcsoft.fr"
CBA_Facture = QRCodeAvecImage
CBA_Facture.Valeur = "QR Code avec un drapeau au centre !"
Properties Properties specific to BarCodes variables The following properties can be used to handle a bar code: | | | Property name | Type used | Effect |
---|
Content | Any type | Value of bar code. - For QR codes, the type of this value depends on the ContentType property .
See the note below to find out the correspondence between the type of content and the type of value. - When reading bar codes other than QR codes, this property is always of type "String" and its value is the same as that of the RoughValue property.
| ContentType | Integer constant | Nature of the data stored in the bar code: - bcTypeText (default value when Variable is created): Plain Text
- bcTypePhone: Phone number
- bcTypeSMS: SMS number
- bcTypeEmail: Address Email
- bcTypeContact: description from an Contact
- bcTypeLocation: Geographical position
- bcTypeURL: URL (bookmark). To insert an http address into the bar code, use the cbTypeText type.
This constant is kept for backward compatibility and it must be used in very specific cases. - bcTypeMarket: Link to an application on Google Play (for an Android application only)
- bcTypeWiFi: Wi-Fi network connection settings (for Android application only)
Remark: These data natures are available for 2D barcodes (e.g. QR Code, Aztec, datamatrix, PDF417, ...).. For the bar codes other than 2D bar codes, the data is always text data. | CorrectionError | Integer constant | Error correction level: defines the threshold for reading a damaged barcode. This property is available for: - the QR Code bar codes.
- the PDF-417 bar codes.
- the Aztec bar codes.
The following constants are available for the QR Code: - qrcodeLevelH: around 30% of encoded words can be restored.
- qrcodeLevelL: around 7% of encoded words can be restored.
- qrcodeLevelM: around 15% of encoded words can be restored.
- qrcodeLevelQ: around 25% of encoded words can be restored.
The selected correction level triggers: - the resizing of bar code.
- the modification of the maximum number of characters allowed in the bar code.
A higher correction level means that the drawing of the bar code will have an important size and that less data will be drawn. On the contrary, a higher correction level means that the bar code will be readable even if the support is damaged. Tips:: - If the bar code contains a URL, the level L is sufficient.
- If a logo is inserted into the bar code, we recommend that you use a higher level (M or Q).
- If the bar code is intended for printing labels for a warehouse, the level H must be used.
For the PDF-417 bar codes, the correction level of the error corresponds to an integer included between 0 and 8. For the Aztec bar codes, the correction level corresponds to an integer included between 5 and 95, representing the percentage of error correction. The default value is 33. If the given value is - less than 5, the value will be set to 5,
- greater than 95, the value will be set to 95,
- negative, the value will be set to 33 (default value).
| Image | | Image added in the center of the bar code (only for QR Codes). This image can correspond to: - a variable of type Image,
- a character string containing the path of the image file to be used,
- an image memo item, etc.
| ImageProportion | Real | Percentage of the area occupied by the image added to the center of the barcode (only for QR codes for which the Image property is specified). This value must not exceed half of the area reserved for error correction. | | Value of the CorrectionError property | Maximum value of the ImageProportion property | qrcodeLevelH | 5 | qrcodeLevelL | 1 | qrcodeLevelM | 3 | qrcodeLevelQ | 5 |
| Options | Integer constant (or combination of constants) | Characteristics of bar code. These characteristics are mainly used when a bar code is printed by iPrintBarCode. The following constants can be used: - CB_Bas: Barcode positioned at bottom of destination rectangle.
- CB_CaracterControle: Bar code containing control characters (valid only for bar codes of type CB_CODE128, CB_DATAMATRIX, CB_EAN128, CB_GS1_128 and CB_PDF417). 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.
For more details, see The different types of bar codes.- CB_VerificationCharacter: Bar code containing check digits (valid only for bar codes of type CB_CODE128, CB_DATAMATRIX, CB_EAN128, CB_GS1_128 and CB_PDF417)..
If this option is selected, the BC_ControlDigits and BC_Charsets constants are automatically taken into account. - CB_CentreH: Horizontal centering of barcode in destination rectangle.
- CB_CentreV: Vertical centering of barcode in destination rectangle.
- CB_Droite: Right-aligned barcode in destination rectangle.
- CB_Etendu: Extended barcode (valid only for CB_CODE39 and CB_CODE93barcodes).
- CB_FormateTexte: Formats the text displayed for EAN 128 barcodes: brackets are added around AIs in the printed text.
- CB_Left: Left-aligned barcode in destination rectangle.
- CB_Haut: Barcode positioned at the top of the destination rectangle.
- CB_IgnoreFormatage: Ignores code 128, EAN-128 or GS1-128 brackets (valid only for barcode types CB_CODE128, CB_EAN128 and CB_GS1_128).
The brackets allow the users to easily read the bar code but they are not drawn in the code. - CB_CharacterSets: Bar code using one or more character sets used for bar code compression.. This set of characters must be defined in the bar code value.
For more details, see The different types of bar codes. - CB_NonProportional: Adjusts the barcode to the size of the destination rectangle.
- CB_SansTexte: Does not display the text under the barcode (valid only for CB_UPCA, CB_UPCB, CB_EAN13 and CB_EAN8barcodes).
- CB_Texte: Displays the text under the strikethrough code.
The text is normalized for the BC_UPCA, BC_UPCE, BC_EAN13 and BC_EAN8 bar codes. For the other types of bar codes, the text can exceed the display border of bar code. - CB_TextCenter: Center the text under the strikethrough (valid only for CB_CODE128, CB_CODE93, CB_CODE11, CB_EAN128, CB_CODE39, CB_INTER2OF5, CB_CODABAR, CB_MSI).
- CB_RightText: Right alignment of the text under the barcode (valid only for barcode types CB_CODE128, CB_CODE93, CB_CODE11, CB_EAN128, CB_CODE39, CB_INTER2OF5, CB_CODABAR, CB_MSI).
- CB_TextLeft: Left alignment of the text under the barcode (valid only for barcode types CB_CODE128, CB_CODE93, CB_CODE11, CB_EAN128, CB_CODE39, CB_INTER2OF5, CB_CODABAR, CB_MSI).
- CB_Vérification: Bar code with check digit (valid only for CB_CODE39, CB_CODE93, CB_INTER2OF5 and CB_CODABARbar codes).
- CB_Vertical: Print barcode vertically.
- CB_90: Prints barcode vertically.
- CB_180: Prints the barcode by rotating it 180 degrees.
- CB_270: Prints barcodes rotated through 270 degrees.
| RoughValue | Unicode string | Rough value of bar code. For barcodes other than QR codes, the value of this property is the same as that of the Content property. This property is read-only. | TypeBarCode | Integer constant | Type of bar code: - CB_AZTEC: AZTEC-type strikethrough code.
- CB_MAXICODE: MaxiCode type barcode.
Not available. - CB_QRCODE: QR Code-type strikethrough code. This constant is used by default when creating a BarCode variable.
- CB_UPCA: UPC-A barcode.
- CB_UPCE: UPC-E barcode.
- CB_EAN8: EAN8-type barcode.
- CB_EAN13: EAN13 barcode.
- CB_CODE39: Code39-type strikethrough code.
- CB_CODE93: Code93-type strikethrough code.
- CB_CODE128: Code128-type strikethrough code.
- CB_GS1_128: GS1-128 strikethrough barcode (new name for EAN128 barcode).
- CB_INTER2OF5: Interleaved 2 of 5 barcode.
- CB_INCONNU: Barcode decoded by the BCCapture function with an unrecognized type..
Note: This constant is available in read-only mode. - CB_DATAMATRIX: DATAMATRIX-type barcode.
This type of bar code is not available. - CB_PDF417: PDF417 barcode.
- CB_CODABAR: Codabar-type barcode.
- CB_CODE11: Code11-type strikethrough code.
This type of bar code is not available. - CB_EAN128: EAN128-type strikethrough code.
This type of bar code is not available. - CB_MSI: MSI-type strikethrough code.
This type of bar code is not available.
These types are also available for the prints performed by iPrintBarCode. |
Remarks Correspondence between the Content and ContentType properties | | | Type of content | Type of value (Content property) | Remark |
---|
bcTypeText | Character string | Example: "WINDEV is good!" | bcTypePhone | Character string | Exemple: "0612345678" | bcTypeSMS | Character string Read: The members of the SMS structure (SMS.Message and SMS.Number) will be automatically populated with the values read from the strikethrough code.. the content will correspond to a string of the form: + RC + In generation: If they exist, members of the SMS structure (SMS.Message and SMS.Number) will be automatically taken into account.. It is also possible to use a character string of the form: + RC + | Example: "0612345678<CR>Text to send" | bcTypeURL | Character string Corresponds to a bookmark. The content will be encoded in the following format: "urlto::URL". For example: "urlto::http://www.pcsoft.fr". Some decoders do not support this type of content. To specify an http address, use the cbTypeText type. Note: This constant is kept for compatibility and must be used in very specific cases. | Example: "http://www.google.com" | bcTypeMarket | Character string | Example: "market://search?q=pname:com.company.application" | bcTypeWiFi | Character string | Character string in the following format: <SSID> + TAB + <Security protocol>+ TAB + <Key> Example: "MyNetwork<TAB>WPA<TAB>pwd" | bcTypeEmail | Character string | Example: "name@email.com" | bcTypeContact | Empty. Read: The members of the mContact structure will be automatically filled in with the values read from the barcode.. In generation: mContact structure members will be automatically used to generate the barcode. | | bcTypeLocation | geoPosition variable. In read mode: The Latitude and Longitude properties of the Variable will be automatically filled in with the values read from the barcode.. In generation: The Latitude and Longitude properties of the Variable will be automatically used to generate the barcode. | |
Functions that use BarCodes variables | | BCCapture | Decodes the information stored in a bar code by using the device camera (Android, iPhone, iPad). | BCDecode | Decodes the information stored in a QR Code bar code. | iPrintBarCode | Prints a bar code (inside a rectangle). |
Note: To reset the contents of a variable of type CodeBars, use function VariableReset.
Related Examples:
|
Android (WINDEV Mobile): Android Inventory
[ + ] This application is used to perform inventories and to save the results in a database.
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|