Versions in this module Expand all Collapse all v0 v0.1.0 Dec 5, 2026 Changes in this version + const MaxInputBytes + const MaxLinearInputBytes + const MaxLogoBytes + const MaxLogoPixels + const MaxLogoSide + const MaxModule + const MaxPixels + const MaxSide + const MaxSpecBytes + const Version + var ErrCheckDigit = fmt.Errorf("wrong barcode check digit: %w", ErrInvalidCode) + var ErrDataTooLong = errors.New("barcode data too long") + var ErrInvalidCode = errors.New("invalid barcode data") + var ErrInvalidOption = errors.New("invalid barcode option") + var ErrTooLarge = errors.New("barcode canvas too large") + var ErrUnsupportedFormat = errors.New("unsupported barcode format") + var ErrUnsupportedType = errors.New("unsupported barcode type") + type Bars struct + func (b Bars) All() iter.Seq[Element] + func (b Bars) Code() string + func (b Bars) Element(i int) Element + func (b Bars) Len() int + func (b Bars) Rows() int + func (b Bars) Width() int + type CheckDigitError struct + Expected int + Supplied int + Type string + func (e *CheckDigitError) Error() string + func (e *CheckDigitError) Unwrap() error + type CodeError struct + Offset int + Reason string + Type string + func (e *CodeError) Error() string + func (e *CodeError) Unwrap() error + type Element struct + Dark bool + Guard bool + Height int + Width int + X int + Y int + type Format uint8 + const HTMLFormat + const JPEGFormat + const PNGFormat + const SVGFormat + func (f Format) ContentType() string + type Generator1D struct + func New1D(opts ...Option1D) (Generator1D, error) + func (Generator1D) Encode(code string, typ Type1D) (Bars, error) + func (g Generator1D) Base64(code string, t Type1D, f Format) (string, error) + func (g Generator1D) DataURI(code string, t Type1D, f Format) (string, error) + func (g Generator1D) Generate(code string, t Type1D, f Format) ([]byte, error) + func (g Generator1D) HTML(code string, t Type1D) ([]byte, error) + func (g Generator1D) JPEG(code string, t Type1D) ([]byte, error) + func (g Generator1D) PNG(code string, t Type1D) ([]byte, error) + func (g Generator1D) Render(b Bars, f Format) ([]byte, error) + func (g Generator1D) SVG(code string, t Type1D) ([]byte, error) + func (g Generator1D) Save(path, code string, t Type1D, f Format) error + func (g Generator1D) With(opts ...Option1D) (Generator1D, error) + func (g Generator1D) WriteTo(w io.Writer, code string, t Type1D, f Format) error + type Generator2D struct + func New2D(opts ...Option2D) (Generator2D, error) + func (Generator2D) Encode(code string, typ Type2D) (Matrix, error) + func (g Generator2D) Base64(code string, t Type2D, f Format) (string, error) + func (g Generator2D) DataURI(code string, t Type2D, f Format) (string, error) + func (g Generator2D) Generate(code string, t Type2D, f Format) ([]byte, error) + func (g Generator2D) HTML(code string, t Type2D) ([]byte, error) + func (g Generator2D) PNG(code string, t Type2D) ([]byte, error) + func (g Generator2D) Render(m Matrix, f Format) ([]byte, error) + func (g Generator2D) SVG(code string, t Type2D) ([]byte, error) + func (g Generator2D) Save(path, code string, t Type2D, f Format) error + func (g Generator2D) With(opts ...Option2D) (Generator2D, error) + func (g Generator2D) WriteTo(w io.Writer, code string, t Type2D, f Format) error + type MacroField interface + func Addressee(v string) MacroField + func Checksum(v int) MacroField + func FileName(v string) MacroField + func FileSize(v int64) MacroField + func SegmentCount(v int) MacroField + func Sender(v string) MacroField + func TimeStamp(v int64) MacroField + type Matrix struct + func (m Matrix) At(x, y int) bool + func (m Matrix) Height() int + func (m Matrix) Type() Type2D + func (m Matrix) Width() int + type Option interface + func Background(c color.NRGBA) Option + func Foreground(c color.NRGBA) Option + func ForegroundCSS(value string) Option + func InlineSVG(inline bool) Option + func Padding(p int) Option + type Option1D interface + func BarWidth(w float64) Option1D + func FontSize(size int) Option1D + func Height(h float64) Option1D + func ShowCode(show bool) Option1D + type Option2D interface + func Logo(src image.Image, fraction float64) Option2D + func LogoBytes(data []byte, fraction float64) Option2D + func ModuleSize(w, h float64) Option2D + type PDF417ECLevel int + const PDF417Auto + const PDF417EC0 + const PDF417EC1 + const PDF417EC2 + const PDF417EC3 + const PDF417EC4 + const PDF417EC5 + const PDF417EC6 + const PDF417EC7 + const PDF417EC8 + type PDF417Option interface + func AspectRatio(ratio float64) PDF417Option + func Macro(total, index, fileID int, fields ...MacroField) PDF417Option + func PDF417ErrorCorrection(level PDF417ECLevel) PDF417Option + type QRLevel int + const QRHigh + const QRLow + const QRMedium + const QRQuartile + type QROption interface + func QRErrorCorrection(level QRLevel) QROption + type Type1D int + const C128 + const C128A + const C128B + const C128C + const C39 + const C39E + const C39EPlus + const C39Plus + const C93 + const Codabar + const Code11 + const EAN13 + const EAN2 + const EAN5 + const EAN8 + const GS1128 + const I25 + const I25Plus + const IMB + const KIX + const MSI + const MSIPlus + const PLANET + const POSTNET + const Pharma + const Pharma2T + const RMS4CC + const S25 + const S25Plus + const UPCA + const UPCE + func ParseType1D(name string) (Type1D, error) + func (t Type1D) String() string + type Type2D interface + String func() string + func DataMatrix() Type2D + func PDF417(opts ...PDF417Option) (Type2D, error) + func ParseType2D(spec string) (Type2D, error) + func QR(opts ...QROption) (Type2D, error)