Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 975 Bytes

README.md

File metadata and controls

34 lines (23 loc) · 975 Bytes

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: