|
|
|
|
|
- UPC and EAN barcodes: Size of barcodes
- Size of bar codes
- Printing a DataMatrix or PDF417 bar code
iPrintBarCode (Function) In french: iImprimeCodeBarre Prints a bar code (inside a rectangle). Remark: Print sent to printer spooler. To actually print the page, use iEndPrinting.
iPrintBarCode("12345678905", BC_INTER2OF5, 10, 10, 23, 50)
iPrintBarCode("12345678905+22", BC_UPCA, 10, 10, 23, 50)
MonQRCode is BarCode
MonQRCode.Content = "http://www.pcsoft.fr"
MonQRCode.ContentType = bcTypeText
MonQRCode.TypeBarCode = BC_QRCODE
iPrintBarCode(MonQRCode, 10, 20, 50, 60)
Syntax
Printing a bar code Hide the details
iPrintBarCode(<Value of bar code> , <Type> , <X1> , <Y1> , <X2> , <Y2> [, <Extended code>])
<Value of bar code>: Character string Character string that will be represented as a bar code. <Type>: Integer constant Type of bar code to represent (the different types of bar codes supported by WINDEV are presented in Managing bar codes). | | | BC_AZTEC | Aztec bar code. | | BC_CODE128 | Code128 bar code. | | BC_CODE39 | Code39 bar code. | Bar code that can be used with <Extended code> corresponding to BC_Extended or BC_Check
The value of the bar code can contain the start and end characters ("*" character). In this case, these characters will be added to the drawing of the bar code and will be printed in the text displayed below the bar code.
If these characters are not found in the value of bar code, they will be automatically added to the drawing of bar code.
However, they will not be printed in the text displayed below the bar code. | BC_CODE93 | Code93 bar code. | Bar code that can be used with <Extended code> corresponding to BC_Extended or BC_Check). | BC_CODE11 | Code11 bar code. | This type of bar code is not available. | BC_INTER2OF5 | Interleaved 2 of 5 bar code. | Bar code that can be used with <Extended code> corresponding to BC_Check. | BC_CODABAR | Codabar bar code. | Bar code that can be used with <Extended code> corresponding to BC_Check. | BC_DATAMATRIX | Data Matrix bar code. | | BC_EAN128 | EAN-128 bar code. | This type of bar code is not available. | BC_EAN13 | EAN-13 bar code. | Possible values for the bar code:- 12 characters,
- 12 characters + 2 additional characters ("012345678912+22" for example)
- 12 characters + 5 additional characters ("012345678912+22335" for example)
A control character is automatically inserted after the 12th character. | BC_EAN8 | EAN-8 bar code. | Possible values for the bar code:- 7 characters,
- 7 characters + 2 additional characters ("0123456+22" for example)
- 12 characters + 5 additional characters ("012345678912+22335" for example)
A control character is automatically inserted after the 7th character. | CB_GS1_128 | GS1-128 bar code (new name for the EAN-128 bar code). | | BC_MAXICODE | MaxiCode bar code. | | BC_MSI | MSI bar code. | This type of bar code is not available. | BC_PDF417 | PDF417 bar code. | | BC_UPCA | UPC-A bar code. | Possible values for the bar code:- 11 characters,
- 11 characters + 2 additional characters ("01234567891+22" for example)
- 11 characters + 5 additional characters ("01234567891+22335" for example)
A control character is automatically inserted after the 11th character. | BC_UPCE | UPC-E bar code. | Possible values for the bar code:- 11 characters,
- 11 characters + 2 additional characters ("01234567891+22" for example)
- 11 characters + 5 additional characters ("01234567891+22335" for example)
A control character is automatically inserted after the 11th character. |
<X1>: Real Horizontal coordinate of the upper-left corner of the rectangle where the bar code will be drawn (in millimeters). Value between 0 and the page width (returned by iPageWidth). <Y1>: Real Vertical coordinate of the upper-left corner of the rectangle where the bar code will be drawn (in millimeters). Value between 0 and the page height (returned by iPageHeight). <X2>: Real Horizontal coordinate of the lower-right corner of the rectangle where the bar code will be drawn (in millimeters). Value between 0 and the page width (returned by iPageWidth). <Y2>: Real Vertical coordinate of the lower-right corner of the rectangle where the bar code will be drawn (in millimeters). Value between 0 and the page height (returned by iPageHeight). <Extended code>: Optional Integer constant (or combination of constants) Characteristics of bar code. | | BC_90 | Prints the bar code vertically. Barcodes concerned: all | BC_180 | Prints the bar code while performing a rotation equal to 180 degrees. Barcodes concerned: all | BC_270 | Prints the bar code while performing a rotation equal to 270 degrees. Barcodes concerned: all | BC_Bottom | Bar code located at the bottom of destination rectangle. Barcodes concerned: all | BC_CenterH | Bar code centered horizontally in the destination rectangle. Barcodes concerned: all | BC_CenterV | Bar code centered vertically in the destination rectangle. Barcodes concerned: all | BC_Charsets | Bar code that uses one or more sets of characters to compress the bar code. This set of characters must be defined in the bar code value. For more details, see The different types of bar codes.Barcodes concerned: all | BC_Check | Bar code with check characters. Bar codes concerned: CB_CODE39, CB_CODE93, CB_INTER2OF5 and CB_CODABAR. | BC_CheckDigits | Bar codes containing check characters. If this option is selected, the BC_ControlDigits and BC_Charsets constants are automatically taken into account.Relevant StrikeOut codes: CB_CODE128, CB_DATAMATRIX, CB_EAN128, CB_GS1_128, CB_PDF417. | BC_ControlDigits | Bar codes containing control characters. 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.Relevant StrikeOut codes: CB_CODE128, CB_DATAMATRIX, CB_EAN128, CB_GS1_128, CB_PDF417. | BC_Extended | Extended bar code. Bar codes concerned: CB_CODE39 and CB_CODE93type bar codes. | BC_FormatText | Formats the text displayed: brackets are added around AIs in the printed text. Bar codes concerned: EAN 128 or GS1-128type bar codes. | BC_IgnoreFormatting | Ignores the brackets found in a 128, EAN-128 or GS1-128 bar code. The brackets allow the users to easily read the bar code but they are not drawn in the code.StrikeOut barcodes: CB_CODE128, CB_EAN128 and CB_GS1_128. | BC_Left | Bar code aligned to left in the destination rectangle. Barcodes concerned: all | BC_NoText | Displays no text below the bar code. StrikeOut barcodes concerned: CB_UPCA, CB_UPCB, CB_EAN13 and CB_EAN8. | BC_NotProportional | Adjusts the bar code to the size of destination rectangle. Barcodes concerned: all | BC_Right | Bar code aligned to right in the destination rectangle. Barcodes concerned: all | BC_Text | Displays the text below the bar 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.Barcodes concerned: all | BC_TextCenter | Centers the text below the bar code. Bar codes concerned: strikethrough type CB_CODE128, CB_CODE93, CB_CODE11, CB_EAN128, CB_CODE39, CB_INTER2OF5, CB_CODABAR, CB_MSI. | BC_TextLeft | Aligns the text below the bar code to the left. Bar codes concerned: strikethrough type CB_CODE128, CB_CODE93, CB_CODE11, CB_EAN128, CB_CODE39, CB_INTER2OF5, CB_CODABAR, CB_MSI. | BC_TextRight | Aligns the text below the bar code to the right. Bar codes concerned: strikethrough type CB_CODE128, CB_CODE93, CB_CODE11, CB_EAN128, CB_CODE39, CB_INTER2OF5, CB_CODABAR, CB_MSI. | BC_Top | Bar code located at the top of destination rectangle. Barcodes concerned: all | BC_Vertical | Prints the bar code vertically. Barcodes concerned: all |
Printing a bar code (BarCode variable) Hide the details
iPrintBarCode(<Bar code> , <X1> , <Y1> , <X2> , <Y2>)
<Bar code>: BarCode variable Name of the BarCode variable containing the description of the bar code to print. <X1>: Real Horizontal coordinate of the upper-left corner of the rectangle where the bar code will be drawn (in millimeters). Value between 0 and the page width (returned by iPageWidth). <Y1>: Real Vertical coordinate of the upper-left corner of the rectangle where the bar code will be drawn (in millimeters). Value between 0 and the page height (returned by iPageHeight). <X2>: Real Horizontal coordinate of the lower-right corner of the rectangle where the bar code will be drawn (in millimeters). Value between 0 and the page width (returned by iPageWidth). <Y2>: Real Vertical coordinate of the lower-right corner of the rectangle where the bar code will be drawn (in millimeters). Value between 0 and the page height (returned by iPageHeight). Remarks UPC and EAN barcodes: Size of barcodes The standard for the UPC and EAN codes defines the proportion between the height and width of bar codes. The drawings of these bar codes respect this standard by default. However, the BC_NotProportional constant allows you to draw "non-standard" bar codes. Remark: The space given for drawing the barcode may not be occupied at 100%. Indeed, the size of each bar is calculated so that a bar code can always be read. The actual width of the drawing of a bar code may be less than the specified width. Indeed, the width of each bar is calculated from the with of the narrowest bar found in the bar code. The width of each bar must be a whole number of pixels. Example for calculating the width of a bar code: - The drawing must be 130-pixel wide.
- The drawing contains 10 narrow bars of width 1 and 5 large bars of width 2.
- Calculating the width of a narrow bar = 110 / (10 + 5*2) = 5 pixels
- Calculating the total width for the drawing = 5 * (10 + 5*2) = 100 pixels
Once the BC_CenterH constant has been used, the drawing will start at (110-100) /2 = 5 pixels from the left border and it will end at 5 pixels from the right border. Printing a DataMatrix or PDF417 bar code The following options are taken into account when a DataMatrix or PDF417 bar code is printed using iPrintBarCode: Data Matrix - Matrix size calculated according to the length of string and optimized to get a squared matrix.
- Character set: WINDEV optimizes the choice of character sets to write the smallest possible barcode.
PDF417 - Matrix size calculated according to 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: 4
- Character set: WINDEV optimizes the choice of character sets to write the smallest possible barcode.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|