You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. [![Join the chat at https://gitter.im/golang-barcode/Lobby](https://badges.gitter.im/golang-barcode/Lobby.svg)](https://gitter.im/golang-barcode/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
  2. ## Introduction ##
  3. This is a package for GO which can be used to create different types of barcodes.
  4. ## Supported Barcode Types ##
  5. * 2 of 5
  6. * Aztec Code
  7. * Codabar
  8. * Code 128
  9. * Code 39
  10. * Code 93
  11. * Datamatrix
  12. * EAN 13
  13. * EAN 8
  14. * PDF 417
  15. * QR Code
  16. ## Example ##
  17. This is a simple example on how to create a QR-Code and write it to a png-file
  18. ```go
  19. package main
  20. import (
  21. "image/png"
  22. "os"
  23. "github.com/boombuler/barcode"
  24. "github.com/boombuler/barcode/qr"
  25. )
  26. func main() {
  27. // Create the barcode
  28. qrCode, _ := qr.Encode("Hello World", qr.M, qr.Auto)
  29. // Scale the barcode to 200x200 pixels
  30. qrCode, _ = barcode.Scale(qrCode, 200, 200)
  31. // create the output file
  32. file, _ := os.Create("qrcode.png")
  33. defer file.Close()
  34. // encode the barcode as png
  35. png.Encode(file, qrCode)
  36. }
  37. ```
  38. ## Documentation ##
  39. See [GoDoc](https://godoc.org/github.com/boombuler/barcode)
  40. To create a barcode use the Encode function from one of the subpackages.