|
|
hace 7 años | |
|---|---|---|
| aztec | hace 8 años | |
| codabar | hace 8 años | |
| code128 | hace 8 años | |
| code39 | hace 8 años | |
| code93 | hace 8 años | |
| datamatrix | hace 8 años | |
| ean | hace 8 años | |
| pdf417 | hace 8 años | |
| qr | hace 8 años | |
| twooffive | hace 8 años | |
| utils | hace 7 años | |
| .gitignore | hace 8 años | |
| LICENSE | hace 11 años | |
| README.md | hace 8 años | |
| barcode.go | hace 8 años | |
| go.mod | hace 7 años | |
| scaledbarcode.go | hace 9 años |
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"
"github.com/boombuler/barcode"
"github.com/boombuler/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.