package pdf417
import "github.com/edragoev1/pdfjet/v9/src/pdf417"
Package pdf417 creates PDF417 barcodes.
Index
-
type PDF417
- func NewPDF417(str string) *PDF417
- func (barcode *PDF417) DrawOn(page *pdfjet.Page) [2]float32
- func (barcode *PDF417) SetAltDescription(altDescription string) *PDF417
- func (barcode *PDF417) SetLocation(x, y float32) pdfjet.Drawable
- func (barcode *PDF417) SetModuleLength(moduleLength float32) *PDF417
Types
type PDF417
type PDF417 struct { // contains filtered or unexported fields }
PDF417 is used to generate PDF417 2D barcodes.
The bars are drawn from the location set with SetLocation. ISO/IEC 15438 asks for a quiet zone of at least two modules (twice the module width) on all four sides of the symbol, so leave that much space around it; scanners reject symbols with less.
Please see Example_38.
func NewPDF417
func NewPDF417(str string) *PDF417
NewPDF417 constructor for 2D barcodes. The symbol has 18 columns and as many rows as the string needs, up to the 928 codewords a PDF417 symbol can hold: 864 data codewords, or about 1,300 characters of mixed text, with the error correction level 5 used here. The string is ASCII, and a control character other than HT, LF and CR takes a codeword of its own and one more, in byte compaction. It panics if there are unencodable characters or the string does not fit in a symbol. @param str the specified string.
func (*PDF417) DrawOn
func (barcode *PDF417) DrawOn(page *pdfjet.Page) [2]float32
DrawOn draws this barcode on the specified page. The bars are black, and the pen of the page is as it was after it. @return x and y coordinates of the bottom right corner of this component.
func (*PDF417) SetAltDescription
func (barcode *PDF417) SetAltDescription(altDescription string) *PDF417
SetAltDescription sets what the barcode says for a screen reader: a tagged document, PDF/UA or a PDF/A of level A, then has the barcode as a figure of that description. Without one, its bars are decoration, which a screen reader skips.
func (*PDF417) SetLocation
func (barcode *PDF417) SetLocation(x, y float32) pdfjet.Drawable
SetLocation sets the location of this barcode on the page. @param x the x coordinate of the top left corner of the barcode. @param y the y coordinate of the top left corner of the barcode.
func (*PDF417) SetModuleLength
func (barcode *PDF417) SetModuleLength(moduleLength float32) *PDF417
SetModuleLength sets the module length of this barcode, the width of its narrowest bar. This changes the barcode size while preserving the aspect. Use value between 0.5 and 0.75 If the value is too small some scanners may have difficulty reading the barcode.