BarcodeUPC

New in version 5.0

BarcodeUPC ( left ;​ top ;​ width ;​ height ;​ text ;​ color ;​ numberSystem )

Argument Type Range Default Note
left num -inf..+inf (required)
top num -inf..+inf (required)
width num 0..inf (required)
height num 0..inf (required)
text str 2..12 (required) Max. 12 digits
color rgba 0..255 black
numberSystem int 0..1 0 Only for UPC-E
Examples

BarcodeUPC(20;​20;​200;​120;​"03600029145") /* UPC-A checksum digit is automatically added. */

BarcodeUPC(20;​20;​200;​120;​"036000291452") /* UPC-A with checksum digit (2). */

BarcodeUPC(20;​20;​200;​120;​"425261";​;​0) /* UPC-E with number system 0. */

BarcodeUPC(20;​20;​200;​120;​"425261";​;​1) /* UPC-E with number system 1. */

Description

The BarcodeUPC() function makes it possible to create UPC-A, UPC-E barcodes and accepts UPC-A code with and without checksum digit. The UPC-5 and UPC-2 add-on codes are only used in addition to UPC-A. xmCHART 5.0.8 or higher required.

Examples:

BARCODE_UPC_01
1

/* Note: Using a high print resolution is recommended for all types of barcodes. */

2

OpenDrawing(240;​100;​print)

3

BarcodeUPC(20;​10;​200;​80;​"19012341234")

4

CloseDrawing()

BARCODE_UPC_01
BARCODE_UPC_02
1

/* Note: Using a high print resolution is recommended for all types of barcodes. */

2

OpenDrawing(280;​160;​print)

3

BarcodeUPC(20;​20;​200;​120;​"03600029145")

4

AddText(7;145;"0";Verdana;15)

5

AddRect(26;130;90;20;white)

6

AddText(38;145;"3 6 0 0 0";Verdana;15)

7

AddRect(123;130;90;20;white)

8

AddText(135;145;"2 9 1 4 5";Verdana;15)

9

CloseDrawing()

BARCODE_UPC_02
BARCODE_UPC_03
1

/* Note: Using a high print resolution is recommended for all types of barcodes. */

2

OpenDrawing(280;​160;​print)

3

BarcodeUPC(20;​20;​200;​120;​"425261";black;0)

4

AddRect(35;130;150;20;white)

5

AddText(70;145;"4 2 5 2 6 1";Verdana;15)

6

CloseDrawing()

BARCODE_UPC_03
BARCODE_UPC_04
1

/* UPC-A + UPC-5 */

2

/* Using a high resolution, e.g. "print" is recommended for all types of barcodes. */

3

OpenDrawing(330;​160;​print)

4

/* UPC-A */

5

BarcodeUPC(20;​20;​200;​120;​"03600029145")

6

AddText(7;145;"0";Verdana;15)

7

AddRect(26;130;90;20;white)

8

AddText(38;145;"3 6 0 0 0";Verdana;15)

9

AddRect(123;130;90;20;white)

10

AddText(135;145;"2 9 1 4 5";Verdana;15)

11

/* UPC-5 */

12

BarcodeUPC(235;40;80;100;"54495")

13

AddText(242;35;"5 4 4 9 5";Verdana;15)

14

Background(white;;0)

15

CloseDrawing()

BARCODE_UPC_04
BARCODE_UPC_05
1

/* UPC-A + UPC-2 */

2

/* Using a high resolution, e.g. "print" is recommended for all types of barcodes. */

3

OpenDrawing(280;​160;​print)

4

/* UPC-A */

5

BarcodeUPC(20;​20;​200;​120;​"03600029145")

6

AddText(7;​145;​"0";​Verdana;​15)

7

AddRect(26;​130;​90;​20;​white)

8

AddText(38;​145;​"3 6 0 0 0";​Verdana;​15)

9

AddRect(123;​130;​90;​20;​white)

10

AddText(135;​145;​"2 9 1 4 5";​Verdana;​15)

11

/* UPC-2 */

12

BarcodeUPC(235;​40;​30;​100;​"12")

13

AddText(240;​35;​"1 2";​Verdana;​15)

14

Background(white;​;​0)

15

CloseDrawing()

BARCODE_UPC_05
Scroll to Top