Zint Barcode Generator

Prev

Next


3. Using the Front End

Zint can be used to generate barcodes as PNG images or as encapsulated Post Script (EPS) files. This page describes how to encode data using the command line front end program.



3.1 Inputting data

The data to encode can be entered at the command line using the -d option, for example:

zint -d 'This Text'

This will encode the text This Text. Zint will use the default symbology, Code 128, and output to the default file out.png in the current directory.



3.2 Directing Output

Output can be directed to a file other than the default using the -o switch. For example:

zint -o here.png -d 'This Text'

draws a Code 128 barcode in the file here.png. If an encapsulated Post Script file is needed simply append the file name with .eps:

zint -o there.eps -d 'This Text'



3.3 Selecting barcode type

Selecting which type of barcode you wish to produce (i.e. which symbology to use) can be done at the command line using the -b or --barcode= switch followed by the appropriate integer value in the following table.



ID

Barcode Name

1

Code 11

2

Standard Code 2 of 5

3

Interleaved 2 of 5

4

Code 2 of 5 IATA

6

Code 2 of 5 Data Logic

7

Code 2 of 5 Industrial

8

Code 3 of 9 (Code 39)

9

Extended Code 3 of 9 (Code 39+)

13

EAN

16

GS1-128 (UCC.EAN-128)

18

Codabar

20

Code 128 (automatic subset switching)

21

Deutshe Post Leitcode

22

Deutshe Post Identcode

23

Code 16K

25

Code 93

28

Flattermarken

29

GS1 DataBar-14

30

GS1 DataBar Limited

31

GS1 DataBar Extended

32

Telepen Alpha

34

UPC A

37

UPC E

40

PostNet

47

MSI Plessey

49

FIM

50

LOGMARS

51

Pharmacode One-Track

52

PZN

53

Pharmacode Two-Track

55

PDF417

56

PDF417 Truncated

57

Maxicode

58

QR Code

60

Code 128 (Subset B)

63

Australia Post Standard Customer

66

Australia Post Reply Paid

67

Australia Post Routing

68

Australia Post Redirection

69

ISBN (EAN-13 with verification stage)

70

Royal Mail 4 State (RM4SCC)

71

Data Matrix

72

EAN-14

74

Codablock-F

75

NVE-18

79

GS1 DataBar-14 Stacked

80

GS1 DataBar-14 Stacked Omnidirectional

81

GS1 DataBar Expanded Stacked

82

PLANET

84

MicroPDF417

85

USPS OneCode

86

Plessey Code

87

Telepen Numeric

89

ITF-14

90

Dutch Post KIX Code

92

Aztec Code

93

DAFT Code

97

Micro QR Code

129

Code 32

130

Composite Symbol with EAN linear component

131

Composite Symbol with GS1-128 linear component

132

Composite Symbol with GS1 DataBar-14 linear component

133

Composite Symbol with GS1 DataBar Limited component

134

Composite Symbol with GS1 DataBar Extended component

135

Composite Symbol with UPC A linear component

136

Composite Symbol with UPC E linear component

137

Composite Symbol with GS1 DataBar-14 Stacked component

138

Composite Symbol with GS1 DataBar-14 Stacked Omnidirectional component

139

Composite Symbol with GS1 DataBar Expanded Stacked component



3.4 Adjusting height

The height of the symbol can be adjusted using the --height switch. For example:

zint --height=100 -d 'This Text'

specifies a symbol height of 100 times the x-resolution of the symbol.



3.5 Adjusting whitespace

The amount of whitespace to the left and right of the generated barcode can be altered using the -w switch. For example:

zint -w 10 -d 'This Text'

specifies a whitespace width of 10 times the x-resolution of the symbol.



3.6 Adding boundary bars and boxes

Zint allows the symbol to be bound with 'boundary bars' using the option --bind. These bars help to prevent misreading of the symbol by corrupting a scan if the scanning beam strays off the top or bottom of the symbol. Zint can also put a border right around the symbol and its whitespace with the --box option. This option is automatically chosen for ITF-14 symbols.

The width of the boundary or box can be specified using the --border switch. For example:

zint --box --border=10 -d 'This'

gives a box with a width 10 times the x-resolution of the symbol.

bound symbol

boxed symbol



3.7 Using colour

The default colours of a symbol are a black symbol on a white background. Zint allows you to change this. The -r switch allows the default colours to be inverted so that a white symbol is shown on a black background. For example the command

zint -r -d 'This'

gives an inverted Code 128 symbol. This is not practical for most symbologies but white-on-black is allowed by the Data Matrix and Aztec Code symbology specifications.

For more specific needs the foreground and background colours can be specified using the --fg= and --bg= options followed by a number in RGB hexadecimal notation (the same system used in HTML). For example the command

zint --fg=004700 -d 'This'

alters the symbol to a dark green as shown below.

symbol with green ink

symbol with pink paper



3.8 Rotating the Symbol

The symbol can be rotated through four orientations using the --rotate= option followed by the angle of rotation as shown below. This option is only available with PNG output.




--rotate=0 (default)




--rotate=180




--rotate=270




--rotate=90





3.9 Other options

Additional options are available which are specific to certain symbologies. These may, for example, control the quantity of error correction data or the size of the symbol. These options are discussed in section 5 of this guide.




Prev

Home

Next

Installation

 

Using the API