|
|
|
|
|
- UPC and EAN bar codes: Size of bar codes
- Size of bar codes
- Printing a DataMatrix or PDF417 bar code
iPrintBarCode (Function) In french: iImprimeCodeBarre Prints a bar code (inside a rectangle). Remark: The print job is sent to the printer spooler. To actually print the page, use iEndPrinting.
// Print bar codes // Interleaved 2 of 5 bar code iPrintBarCode("12345678905", BC_INTER2OF5, 10, 10, 23, 50) // UPCA bar code iPrintBarCode("12345678905+22", BC_UPCA, 10, 10, 23, 50) MyQRCode is BarCode MyQRCode.Content = "http://www.windev.com" MyQRCode.ContentType = bcTypeText MyQRCode.TypeBarCode = BC_QRCODE iPrintBarCode(MyQRCode, 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. Affected bar codes: all | BC_180 | Prints the bar code while performing a rotation equal to 180 degrees. Affected bar codes: all | BC_270 | Prints the bar code while performing a rotation equal to 270 degrees. Affected bar codes: all | BC_Bottom | Bar code located at the bottom of destination rectangle. Affected bar codes: all | BC_CenterH | Bar code centered horizontally in the destination rectangle. Affected bar codes: all | BC_CenterV | Bar code centered vertically in the destination rectangle. Affected bar codes: all | BC_Charsets | Bar code that uses one or more sets of characters in order to compress the bar code. This set of characters must be defined in the value of bar code. For more details, see The different types of bar codes.Affected bar codes: all | BC_Check | Bar code with check characters. Affected bar codes: BC_CODE39, BC_CODE93, BC_INTER2OF5 and BC_CODABAR bar codes. | BC_CheckDigits | Bar codes containing check characters. If this option is selected, the BC_ControlDigits and BC_Charsets constants are automatically taken into account.Affected bar codes: BC_CODE128, BC_DATAMATRIX, BC_EAN128, BC_GS1_128 and BC_PDF417 bar codes. | 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.Affected bar codes: BC_CODE128, BC_DATAMATRIX, BC_EAN128, BC_GS1_128 and BC_PDF417 bar codes. | BC_Extended | Extended bar code. Affected bar codes: BC_CODE39 and BC_CODE93 bar codes. | BC_FormatText | Formats the text displayed: brackets are added around AIs in the printed text. Affected bar codes: EAN 128 or GS1-128 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.Affected bar codes: CB_CODE128, CB_EAN128 and CB_GS1_128 bar codes. | BC_Left | Bar code aligned to left in the destination rectangle. Affected bar codes: all | BC_NoText | Displays no text below the bar code. Affected bar codes: BC_UPCA, Bc_UPCB, BC_EAN13 and BC_EAN8 bar codes. | BC_NotProportional | Adjusts the bar code to the size of destination rectangle. Affected bar codes: all | BC_Right | Bar code aligned to right in the destination rectangle. Affected bar codes: 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.Affected bar codes: all | BC_TextCenter | Centers the text below the bar code. Affected bar codes: BC_CODE128, BC_CODE93, BC_CODE11, BC_EAN128, BC_CODE39, BC_INTER2OF5, BC_CODABAR and BC_MSI bar codes. | BC_TextLeft | Aligns the text below the bar code to the left. Affected bar codes: BC_CODE128, BC_CODE93, BC_CODE11, BC_EAN128, BC_CODE39, BC_INTER2OF5, BC_CODABAR and BC_MSI bar codes. | BC_TextRight | Aligns the text below the bar code to the right. Affected bar codes: BC_CODE128, BC_CODE93, BC_CODE11, BC_EAN128, BC_CODE39, BC_INTER2OF5, BC_CODABAR and BC_MSI bar codes. | BC_Top | Bar code located at the top of destination rectangle. Affected bar codes: all | BC_Vertical | Prints the bar code vertically. Affected bar codes: 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 bar codes: Size of bar codes 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 used to draw the bar code cannot 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.
- Set of characters: WINDEV optimizes the choice of character sets in order to write the bar code with the smallest possible characters.
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
- from 161 to 320 characters: level 4
- from 321 characters: level 5
- Row height: 4
- Set of characters: WINDEV optimizes the choice of character sets in order to write the bar code with the smallest possible characters.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|