A barcode creation lib for golang (evacuated from NSA/Microsoft Github)
anonymous c7b93b4694 Merge branch 'master' of https://notabug.org/makenotabuggreatagain/barcode | 6 jaren geleden | |
---|---|---|
aztec | 6 jaren geleden | |
codabar | 6 jaren geleden | |
code128 | 6 jaren geleden | |
code39 | 6 jaren geleden | |
code93 | 6 jaren geleden | |
datamatrix | 6 jaren geleden | |
debian | 6 jaren geleden | |
ean | 6 jaren geleden | |
pdf417 | 6 jaren geleden | |
qr | 6 jaren geleden | |
twooffive | 6 jaren geleden | |
utils | 6 jaren geleden | |
LICENSE | 10 jaren geleden | |
README.md | 6 jaren geleden | |
barcode.go | 7 jaren geleden | |
github_mentions | 6 jaren geleden | |
scaledbarcode.go | 7 jaren geleden |
This is a package for GO which can be used to create different types of barcodes.
This is a simple example on how to create a QR-Code and write it to a png-file
package main
import (
"image/png"
"os"
"notabug.org/makenotabuggreatagain/barcode"
"notabug.org/makenotabuggreatagain/barcode/qr"
)
func main() {
// Create the barcode
qrCode, _ := qr.Encode("Hello World", qr.M, qr.Auto)
// Scale the barcode to 200x200 pixels
qrCode, _ = barcode.Scale(qrCode, 200, 200)
// create the output file
file, _ := os.Create("qrcode.png")
defer file.Close()
// encode the barcode as png
png.Encode(file, qrCode)
}
See GoDoc
To create a barcode use the Encode function from one of the subpackages.