diff options
| author | Kurt <kurt.w.jung@gmail.com> | 2016-05-16 15:08:59 -0400 | 
|---|---|---|
| committer | Kurt <kurt.w.jung@gmail.com> | 2016-05-16 15:08:59 -0400 | 
| commit | ff13dc5b70f7db15ecfba5d9108b3324f5f41cd0 (patch) | |
| tree | 83330bcd05345bd87d0be38121f26175fcd04fec /contrib/barcode/barcode.go | |
| parent | 8dd14effba59e4816750d0009e644da1e44b073a (diff) | |
Enhance documentation and add test for PDF417 barcode
Diffstat (limited to 'contrib/barcode/barcode.go')
| -rw-r--r-- | contrib/barcode/barcode.go | 13 | 
1 files changed, 8 insertions, 5 deletions
diff --git a/contrib/barcode/barcode.go b/contrib/barcode/barcode.go index faed915..b2ba2c2 100644 --- a/contrib/barcode/barcode.go +++ b/contrib/barcode/barcode.go @@ -32,8 +32,8 @@ import (  	"github.com/boombuler/barcode/ean"  	"github.com/boombuler/barcode/qr"  	"github.com/boombuler/barcode/twooffive" -	"github.com/ruudk/golang-pdf417"  	"github.com/jung-kurt/gofpdf" +	"github.com/ruudk/golang-pdf417"  )  // barcodes represents the barcodes that have been registered through this @@ -132,12 +132,15 @@ func RegisterDataMatrix(pdf barcodePdf, code string) string {  	return registerBarcode(pdf, bcode, err)  } -// RegisterPdf417 registers a barcode of type Pdf417 to the PDF, but not -// to the page. Use Barcode() with the return value to put the barcode on the -// page. +// RegisterPdf417 registers a barcode of type Pdf417 to the PDF, but not to the +// page. code is the string to be encoded. columns specifies the number of +// barcode columns; this should be a value between 1 and 30 inclusive. +// securityLevel specifies an error correction level between zero and 8 +// inclusive. Barcodes for use with FedEx must set columns to 10 and +// securityLevel to 5. Use Barcode() with the return value to put the barcode +// on the page.  func RegisterPdf417(pdf barcodePdf, code string, columns int, securityLevel int) string {  	bcode := pdf417.Encode(code, columns, securityLevel) -  	return registerBarcode(pdf, bcode, nil)  }  | 
