<< Click to Display Table of Contents >> VpeBarcode |
[Enhanced Edition and above]
Generates and draws a barcode within a rectangle at position x, y, with the right border at x2 and the bottom border at y2.
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 with VpeSetTextColor. 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.
void VpeBarcode(
VpeHandle hDoc,
VpeCoord x,
VpeCoord y,
VpeCoord x2,
VpeCoord y2,
int code_type,
LPCSTR code,
LPCSTR add_code
)
VpeHandle hDoc
Document Handle
VpeCoord x, y, x2, y2
position and dimensions
int code_type
see below
LPCSTR code
string with the code (e.g. "123456")
LPCSTR add_code
string with the add-on code, if add-on barcode type chosen, else NULL (0)
the parameter "code_type" can be one of the following values:
Constant Name |
Value |
Comment |
BCT_EAN13 |
1 |
Checkdigit required, OCR-B Font required |
BCT_EAN13_2 |
10 |
Checkdigit required, OCR-B Font required |
BCT_EAN13_5 |
11 |
Checkdigit required, OCR-B Font required |
BCT_EAN8 |
2 |
Checkdigit required, OCR-B Font required |
BCT_EAN8_2 |
12 |
Checkdigit required, OCR-B Font required |
BCT_EAN8_5 |
13 |
Checkdigit required, OCR-B Font required |
BCT_UPCA |
3 |
Checkdigit required, OCR-B Font required |
BCT_UPCA_2 |
14 |
Checkdigit required, OCR-B Font required |
BCT_UPCA_5 |
15 |
Checkdigit required, OCR-B Font required |
BCT_UPCE |
9 |
first digit always '0', Checkdigit required,OCR-B Font required |
BCT_UPCE_2 |
16 |
first digit always '0', Checkdigit required, OCR-B Font required |
BCT_UPCE_5 |
17 |
first digit always '0', Checkdigit required, OCR-B Font required |
BCT_EAN2 |
28 |
no Checkdigit |
BCT_EAN5 |
29 |
no Checkdigit |
BCT_CODABAR |
5 |
Checkdigit optional, uThick / uThin |
BCT_2OF5 |
7 |
2 of 5 Industrial (25ID), Checkdigit optional, uThick / uThin |
BCT_INTERLEAVED2OF5 |
8 |
2 of 5 Interleaved (25IL), Checkdigit optional, uThick / uThin |
BCT_CODE39 |
6 |
Code 3 of 9, Checkdigit optional, uThick / uThin |
BCT_CODE39EXT |
30 |
Code 3 of 9 Extended, Checkdigit optional, uThick / uThin |
BCT_CODE93 |
21 |
Code 93, Checkdigit optional |
BCT_CODE93EXT |
31 |
Code 93 Extended, Checkdigit optional |
BCT_POSTNET |
22 |
uThick / uThin |
BCT_CODE128 |
26 |
set of CODE 128A, B and C, Checkdigit required |
BCT_EAN128 |
27 |
set of EAN 128A, B and C, Checkdigit required |
BCT_RM4SCC |
32 |
Royal Mail 4 State Customer Code, Checkdigit required |
BCT_MSI |
33 |
Checkdigit optional, uThick / uThin |
BCT_ISBN |
34 |
International Standard Book Number, Checkdigit required |
BCT_ISBN_5 |
35 |
ISBN + EAN5 (for pricing), Checkdigit required |
BCT_IDENTCODE |
36 |
Identcode of the Deutsche Post AG, Checkdigit required |
BCT_LEITCODE |
37 |
Leitcode of the Deutsche Post AG, Checkdigit required |
BCT_PZN |
38 |
Pharma Zentral Code, Checkdigit required, uThick / uThin |
BCT_CODE11 |
39 |
Code 11, Checkdigit optional, uThick / uThin |
BCT_2OF5MATRIX |
40 |
2 of 5 Matrix, Checkdigit optional, uThick / uThin |
BCT_TELEPENA |
41 |
Telepen-A, Checkdigit optional |
BCT_INTELLIGENT_MAIL |
42 |
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.
"Barcodes (1D)" in the Programmer's Manual