Documentation
¶
Index ¶
Constants ¶
View Source
const ( Width = tspl.PrintWidthDots Margin = 8 CodeWidth = Width - 2*Margin MaxHeightDots = 16000 // 2m of paper MaxBlocks = 32 MaxBannerDots = 2400 // 300mm, text or barcodes turned to run along the paper MaxPixels = 50_000_000 )
View Source
const ( KindText = "text" KindImage = "image" KindQR = "qr" KindBarcode = "barcode" KindSpacer = "spacer" KindLine = "line" )
Variables ¶
View Source
var ( ErrEmpty = errors.New("the label has nothing on it") ErrTooTall = errors.New("label too tall") )
Functions ¶
Types ¶
type Block ¶
type Block struct {
Kind string `json:"kind"`
Text string `json:"text,omitzero"`
Data string `json:"data,omitzero"`
Image []byte `json:"image,omitzero"` // png, jpeg, gif, bmp, webp or tiff
Font string `json:"font,omitzero"`
Size int `json:"size,omitzero"` // dots, text em size / qr side / spacer height / line thickness
Align string `json:"align,omitzero"`
Rotate int `json:"rotate,omitzero"` // clockwise
Invert bool `json:"invert,omitzero"`
Fit string `json:"fit,omitzero"` // "width" also enlarges narrow images
Dither string `json:"dither,omitzero"`
Threshold int `json:"threshold,omitzero"`
Brightness int `json:"brightness,omitzero"`
Contrast int `json:"contrast,omitzero"`
Level string `json:"level,omitzero"`
Symbology string `json:"symbology,omitzero"`
Height int `json:"height,omitzero"`
HideText bool `json:"hide_text,omitzero"`
Checksum bool `json:"checksum,omitzero"`
}
type BlockError ¶
func (*BlockError) Error ¶
func (e *BlockError) Error() string
func (*BlockError) Unwrap ¶
func (e *BlockError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.