Categorygithub.com/ingridhq/maxicode
repositorypackage
1.3.0
Repository: https://github.com/ingridhq/maxicode.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

maxicode

Library for creating UPS MaxiCodes written in pure Go

Usage


inputData := "[)>" + RS + "01" + GS + "09651147" + GS + "276" + GS + "066" + GS + "1Z12345677" + GS + "UPSN" + GS + "1X2X3X" + GS + "187" + GS + "" + GS + "1/1" + GS + "10" + GS + "N" + GS + "5 WALDSTRASSE" + GS + "COLOGNE" + GS + "" + RS + "" + EOT
mode := 3
eci := 0
scaleFactor := 35.0

grid, err := maxicode.Encode(mode, eci, inputData)
if grid != nil {
    t.Fatalf(err.Error())
}

err = grid.Draw(scaleFactor).SavePNG("maxicode.png")
if err != nil {
    t.Fatalf(err.Error())
}

Above code will produce the following image:

MaxiCode Mode 3

You can use different scaleFactors to scale maxicodes up/down. Normally scaleFactors should depend on your dpi/dpmm

Contributors

Special thanks for: