barcodes/generation/code39.go

20 lines
451 B
Go

package generation
import (
"fmt"
"github.com/boombuler/barcode"
"github.com/boombuler/barcode/code39"
)
func generateCode39(parameters Parameters) (barcode.Barcode, error) {
var strippedBarcode barcode.Barcode
GeneratedBarcode, err := code39.Encode(parameters.Content, true, true)
if err != nil {
fmt.Println("Error creating Barcode", err)
} else {
strippedBarcode = GeneratedBarcode.(barcode.Barcode)
}
return strippedBarcode, err
}