<< Click to Display Table of Contents >> Barcode |
[Enhanced Edition and above]
Generates and draws a barcode within a rectangle at position Left, Top with the right border at Right and the bottom border at Bottom.
VPE doesn't enforce the absolute size of the barcode (left to the responsibility of the caller), but it does enforce the exactness of the relative widths of the bars at the output device's pixel level (other than screen).
Consider a barcode consisting of 1 bar, 1 space and 1 bar, with width ratios 3:1:2. The minimum width of the barcode is 6 pixels, other possible sizes are 12, 18 and so on. If you give a rectangle where only 5 pixels might fit, the barcode will still occupy 6 pixels. Don't make the rectangle too small. Normally the barcodes will be drawn inside the rectangle and as big as possible due to the exactness of the relative widths of the bars.
The color of bars and barcode text is set by TextColor. The font used for the barcode labels can be specified with the property FontName, for example UPC-A and UPC-E require an OCR-B font. In addition the font size for barcode labels can be specified with the property FontSize.
method void VPE.Barcode(
VpeCoord Left,
VpeCoord Top,
VpeCoord Right,
VpeCoord Bottom,
BarcodeType [integer] CodeType,
string Code,
string AddCode
)
VpeCoord Left, Top, Right, Bottom
position and dimensions
BarcodeType [integer] CodeType
see below
string Code
string with the code (e.g. "123456")
string AddCode
string with the add-on code, if add-on barcode type chosen, else "" (empty string or NULL (0))
the parameter "CodeType" can be one of the following values:
ActiveX / VCL |
Value |
Enum |
Comment |
BCT_EAN13 |
1 |
Ean13 |
Checkdigit required, OCR-B Font required |
BCT_EAN13_2 |
10 |
Ean13_2 |
Checkdigit required, OCR-B Font required |
BCT_EAN13_5 |
11 |
Ean13_5 |
Checkdigit required, OCR-B Font required |
BCT_EAN8 |
2 |
Ean8 |
Checkdigit required, OCR-B Font required |
BCT_EAN8_2 |
12 |
Ean8_2 |
Checkdigit required, OCR-B Font required |
BCT_EAN8_5 |
13 |
Ean8_5 |
Checkdigit required, OCR-B Font required |
BCT_UPCA |
3 |
UpcA |
Checkdigit required, OCR-B Font required |
BCT_UPCA_2 |
14 |
UpcA_2 |
Checkdigit required, OCR-B Font required |
BCT_UPCA_5 |
15 |
UpcA_5 |
Checkdigit required, OCR-B Font required |
BCT_UPCE |
9 |
UpcE |
first digit always '0', Checkdigit required,OCR-B Font required |
BCT_UPCE_2 |
16 |
UpcE_2 |
first digit always '0', Checkdigit required, OCR-B Font required |
BCT_UPCE_5 |
17 |
UpcE_5 |
first digit always '0', Checkdigit required, OCR-B Font required |
BCT_EAN2 |
28 |
Ean2 |
no Checkdigit |
BCT_EAN5 |
29 |
Ean5 |
no Checkdigit |
BCT_CODABAR |
5 |
Codabar |
Checkdigit optional, uThick / uThin |
BCT_2OF5 |
7 |
B2Of5 |
2 of 5 Industrial (25ID), Checkdigit optional, uThick / uThin |
BCT_INTERLEAVED2OF5 |
8 |
Interleaved2Of5 |
2 of 5 Interleaved (25IL), Checkdigit optional, uThick / uThin |
BCT_CODE39 |
6 |
Code39 |
Code 3 of 9, Checkdigit optional, uThick / uThin |
BCT_CODE39EXT |
30 |
Code39Ext |
Code 3 of 9 Extended, Checkdigit optional, uThick / uThin |
BCT_CODE93 |
21 |
Code93 |
Code 93, Checkdigit optional |
BCT_CODE93EXT |
31 |
Code93Ext |
Code 93 Extended, Checkdigit optional |
BCT_POSTNET |
22 |
Postnet |
uThick / uThin are fixed |
BCT_CODE128 |
26 |
Code128 |
set of CODE 128A, B and C, Checkdigit required |
BCT_EAN128 |
27 |
Ean128 |
set of EAN 128A, B and C, Checkdigit required |
BCT_RM4SCC |
32 |
Rm4Scc |
Royal Mail 4 State Customer Code, Checkdigit required |
BCT_MSI |
33 |
Msi |
Checkdigit optional, uThick / uThin |
BCT_ISBN |
34 |
Isbn |
International Standard Book Number, Checkdigit required |
BCT_ISBN_5 |
35 |
Isbn_5 |
ISBN + EAN5 (for pricing), Checkdigit required |
BCT_IDENTCODE |
36 |
Identcode |
Identcode of the Deutsche Post AG, Checkdigit required |
BCT_LEITCODE |
37 |
Leitcode |
Leitcode of the Deutsche Post AG, Checkdigit required |
BCT_PZN |
38 |
Pzn |
Pharma Zentral Code, Checkdigit required, uThick / uThin |
BCT_CODE11 |
39 |
Code11 |
Code 11, Checkdigit optional, uThick / uThin |
BCT_2OF5MATRIX |
40 |
B2OF5Matrix |
2 of 5 Matrix, Checkdigit optional, uThick / uThin |
BCT_TELEPENA |
41 |
TelepenA |
Telepen-A, Checkdigit optional |
BCT_INTELLIGENT_MAIL |
42 |
IntelligentMail |
Intelligent Mail |
Remarks:
VPE offers several methods to attach an object's position to margins and relative to the position of previously inserted objects. In addition Text, Rich Text and Picture objects are able to compute their dimensions automatically depending on their visual content.
For details please see "Dynamic Positioning" in the Programmer's Manual.
If you are using the ActiveX, do not supply the value 0 (zero) for the AddCode parameter, if the barcode type does not support add-on codes.
Instead, supply an empty string, i.e. "".
Example:
Doc.Barcode 1, 1, -4, -1, BCT_INTERLEAVED2OF5, "12345", ""