...
1[](https://gitter.im/golang-barcode/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
2
3## Introduction ##
4
5This is a package for GO which can be used to create different types of barcodes.
6
7## Supported Barcode Types ##
8* 2 of 5
9* Aztec Code
10* Codabar
11* Code 128
12* Code 39
13* Code 93
14* Datamatrix
15* EAN 13
16* EAN 8
17* PDF 417
18* QR Code
19
20## Example ##
21
22This is a simple example on how to create a QR-Code and write it to a png-file
23```go
24package main
25
26import (
27 "image/png"
28 "os"
29
30 "github.com/boombuler/barcode"
31 "github.com/boombuler/barcode/qr"
32)
33
34func main() {
35 // Create the barcode
36 qrCode, _ := qr.Encode("Hello World", qr.M, qr.Auto)
37
38 // Scale the barcode to 200x200 pixels
39 qrCode, _ = barcode.Scale(qrCode, 200, 200)
40
41 // create the output file
42 file, _ := os.Create("qrcode.png")
43 defer file.Close()
44
45 // encode the barcode as png
46 png.Encode(file, qrCode)
47}
48```
49
50## Documentation ##
51See [GoDoc](https://godoc.org/github.com/boombuler/barcode)
52
53To create a barcode use the Encode function from one of the subpackages.
View as plain text