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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?