Skip to content

Library for creating UPS MaxiCodes written in pure Go

License

Notifications You must be signed in to change notification settings

ingridhq/maxicode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

About

Library for creating UPS MaxiCodes written in pure Go

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages