summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuud Kamphuis <ruudk@mphuis.com>2016-05-15 16:58:49 +0200
committerRuud Kamphuis <ruudk@mphuis.com>2016-05-15 16:58:49 +0200
commit4b43e5554e8c7b89e56d9e87b1b8977d1b89168c (patch)
treee6b3ada185be9e9bd4725bf316c0cb20a4313d02
parentbcfb7a87cbd135e18715e0b68ac4a31de4b04d5f (diff)
Add support for Pdf417 barcodes
-rw-r--r--contrib/barcode/barcode.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/contrib/barcode/barcode.go b/contrib/barcode/barcode.go
index 4a143da..c5e4193 100644
--- a/contrib/barcode/barcode.go
+++ b/contrib/barcode/barcode.go
@@ -32,6 +32,7 @@ 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"
)
@@ -131,6 +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.
+func RegisterPdf417(pdf barcodePdf, code string) string {
+ bcode := pdf417.Encode(code)
+
+ return registerBarcode(pdf, bcode, nil)
+}
+
// RegisterEAN registers a barcode of type EAN to the PDF, but not to the page.
// It will automatically detect if the barcode is EAN8 or EAN13. Use Barcode()
// with the return value to put the barcode on the page.