barcode

a barcode creation lib for golang

Github星跟踪图

Join the chat at https://gitter.im/golang-barcode/Lobby

Introduction

This is a package for GO which can be used to create different types of barcodes.

Supported Barcode Types

  • 2 of 5
  • Aztec Code
  • Codabar
  • Code 128
  • Code 39
  • Code 93
  • Datamatrix
  • EAN 13
  • EAN 8
  • PDF 417
  • QR Code

Example

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)
}

Documentation

See GoDoc

To create a barcode use the Encode function from one of the subpackages.

主要指标

概览
名称与所有者boombuler/barcode
主编程语言Go
编程语言Go (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2013-12-11 13:28:59
推送于2025-01-24 13:21:26
最后一次提交2025-01-24 14:21:26
发布数3
最新版本名称v1.0.2 (发布于 )
第一版名称v1.0.0 (发布于 )
用户参与
星数1.5k
关注者数41
派生数176
提交数124
已启用问题?
问题数62
打开的问题数9
拉请求数18
打开的拉请求数1
关闭的拉请求数7
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?