Documentation
¶
Index ¶
- type Barcode2of5
- type Barcode2of5WithData
- type Barcode39
- type Barcode39WithData
- type Barcode128
- type Barcode128WithData
- type BarcodeAztec
- type BarcodeAztecWithData
- type BarcodeDatamatrix
- type BarcodeDatamatrixWithData
- type BarcodeDimensions
- type BarcodeEan13
- type BarcodeEan13WithData
- type BarcodeMode
- type BarcodePdf417
- type BarcodePdf417WithData
- type BarcodeQr
- type BarcodeQrWithData
- type DatamatrixRatio
- type FieldAlignment
- type FieldBlock
- type FieldInfo
- type FieldOrientation
- type FontInfo
- type GraphicBox
- type GraphicCircle
- type GraphicDiagonalLine
- type GraphicField
- type GraphicFieldFormat
- type GraphicSymbol
- type LabelPosition
- type LineColor
- type Maxicode
- type MaxicodeWithData
- type QrCharacterMode
- type QrErrorCorrectionLevel
- type RecalledField
- type RecalledFieldData
- type RecalledFormat
- type ReversePrint
- type StoredField
- type StoredFormat
- type StoredGraphics
- type TextAlignment
- type TextField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Barcode2of5 ¶
type Barcode2of5 struct {
// The bar code orientation to use.
// Valid values are N (no rotation), R (rotate 90° clockwise), I (rotate 180° clockwise), and B (rotate 270° clockwise).
// The default value is the orientation configured via the ^FW command, which itself defaults to N (no rotation).
Orientation FieldOrientation
// The bar code height, in dots.
// Any number between 1 and 32,000 may be used.
// The default value is the bar code height configured via the ^BY command, which itself defaults to 10.
Height int
// Whether or not to include human-readable text with the bar code.
// Valid values are Y and N. The default value is Y (include human-readable text).
Line bool
// Whether or not to place the human-readable text above the bar code.
// Valid values are Y and N. The default value is N (if printed, text is placed below the bar code).
LineAbove bool
// Whether or not to add a check digit to the bar code. Valid values are Y and N.
// The default value is N (no check digit).
CheckDigit bool
}
type Barcode2of5WithData ¶
type Barcode2of5WithData struct {
ReversePrint
Barcode2of5
Width int
WidthRatio float64
Position LabelPosition
Data string
}
type Barcode39 ¶
type Barcode39 struct {
// The bar code orientation to use.
// Valid values are N (no rotation), R (rotate 90° clockwise), I (rotate 180° clockwise), and B (rotate 270° clockwise).
// The default value is the orientation configured via the ^FW command, which itself defaults to N (no rotation).
Orientation FieldOrientation
// The bar code height, in dots.
// Any number between 1 and 32,000 may be used.
// The default value is the bar code height configured via the ^BY command, which itself defaults to 10.
Height int
// Whether or not to include human-readable text with the bar code.
// Valid values are Y and N. The default value is Y (include human-readable text).
Line bool
// Whether or not to place the human-readable text above the bar code.
// Valid values are Y and N. The default value is N (if printed, text is placed below the bar code).
LineAbove bool
// Whether or not to add a check digit to the bar code. Valid values are Y and N.
// The default value is N (no check digit).
CheckDigit bool
}
type Barcode39WithData ¶
type Barcode39WithData struct {
ReversePrint
Barcode39
Width int
WidthRatio float64
Position LabelPosition
Data string
}
type Barcode128 ¶
type Barcode128 struct {
// The bar code orientation to use.
// Valid values are N (no rotation), R (rotate 90° clockwise), I (rotate 180° clockwise), and B (rotate 270° clockwise).
// The default value is the orientation configured via the ^FW command, which itself defaults to N (no rotation).
Orientation FieldOrientation
// The bar code height, in dots.
// Any number between 1 and 32,000 may be used.
// The default value is the bar code height configured via the ^BY command, which itself defaults to 10.
Height int
// Whether or not to include human-readable text with the bar code.
// Valid values are Y and N.
// The default value is Y (include human-readable text).
Line bool
// Whether or not to place the human-readable text above the bar code.
// Valid values are Y and N.
// The default value is N (if printed, text is placed below the bar code),
// except for mode U where the default is Y (if printed, text is placed above the bar code).
LineAbove bool
// Whether or not to calculate a GS1 (UCC) Mod 10 check digit.
// Valid values are Y and N.
// The default value is N (GS1 check digit is not calculated).
// TODO: Figure out if it should be implemented, as it's part of the interface but reference libraries disregard this value.
CheckDigit bool
// The mode to use to encode the bar code data.
// Valid values are N (no mode, subsets are specified explicitly as part of the field data),
// U (UCC case mode, field data must contain 19 digits),
// A (automatic mode, the ZPL engine automatically determines the subsets that are used to encode the data),
// and D (UCC/EAN mode, field data must contain GS1 numbers).
// The default value is N (no mode, subsets are specified explicitly as part of the field data).
Mode BarcodeMode
}
type Barcode128WithData ¶
type Barcode128WithData struct {
ReversePrint
Barcode128
Width int
Position LabelPosition
Data string
}
type BarcodeAztec ¶
type BarcodeAztec struct {
// The bar code orientation to use.
// Valid values are N (no rotation),
// R (rotate 90° clockwise),
// I (rotate 180° clockwise), and B (rotate 270° clockwise).
// The default value is the orientation configured via the ^FW command, which itself defaults to N (no rotation).
Orientation FieldOrientation
// The bar code magnification to use.
// Any number between 1 and 10 may be used.
// The default value depends on the print density being used.
Magnification int
// The Aztec bar code size to use.
// Valid values are 101-104 (compact Aztec code sizes),
// 201-232 (full-range Aztec code sizes),
// 300 (Aztec runes),
// and 1-99 (dynamic sizing for a specific minimum error correction percentage).
// By default, the bar code is sized dynamically to fit the encoded data.
Size int
}
type BarcodeAztecWithData ¶
type BarcodeAztecWithData struct {
ReversePrint
BarcodeAztec
Position LabelPosition
Data string
}
type BarcodeDatamatrix ¶
type BarcodeDatamatrix struct {
// The bar code orientation to use.
// Valid values are N (no rotation), R (rotate 90° clockwise), I (rotate 180° clockwise), and B (rotate 270° clockwise).
// The default value is the orientation configured via the ^FW command, which itself defaults to N (no rotation).
Orientation FieldOrientation
// The bar code element height, in dots. The individual elements are square, so the element height and width will be the same.
// Any number between 1 and the label width may be used.
// The default value is the element height necessary for the total bar code height to match the bar code height configured via the ^BY command.
Height int
// The level of error correction to apply.
// Valid values are 0 (ECC 0), 50 (ECC 50), 80 (ECC 80), 100 (ECC 100), 140 (ECC 140) and 200 (ECC 200).
// The default value is 0 (scan errors are detected but not corrected). Always use quality level 200 (ECC 200).
Quality int
// The number of columns to encode. For ECC 200 bar codes, even numbers between 1 and 144 may be used.
// This parameter can be used to control the bar code width. The default value depends on the amount of data encoded.
Columns int
// The number of rows to encode. For ECC 200 bar codes, even numbers between 1 and 144 may be used.
// This parameter can be used to control the bar code height. The default value depends on the amount of data encoded.
Rows int
// The type of data that needs to be encoded.
// Valid values are 1, 2, 3, 4, 5 and 6. The default value is 6.
// This parameter is ignored for ECC 200 bar codes (the recommended quality level).
Format int
// The escape character used to escape control sequences in the field data. The default value is "~" (tilde).
Escape byte
// The desired aspect ratio, if any. Valid values are 1 (square) and 2 (rectangular).
Ratio DatamatrixRatio
}
type BarcodeDatamatrixWithData ¶
type BarcodeDatamatrixWithData struct {
ReversePrint
BarcodeDatamatrix
Position LabelPosition
Data string
}
type BarcodeDimensions ¶
type BarcodeDimensions struct {
ModuleWidth int
Height int
// widthRatio: The default ratio between wide bars and narrow bars. Any decimal number between 2 and 3 may be used.
// The number must be a multiple of 0.1 (i.e. 2.0, 2.1, 2.2, 2.3, ... , 2.9, 3.0).
// Larger numbers generally result in fewer bar code scan failures.
// The default value is the previously configured value, or 3 if no value has been set.
WidthRatio float64
}
type BarcodeEan13 ¶ added in v1.29.0
type BarcodeEan13 struct {
// The bar code orientation to use.
// Valid values are N (no rotation), R (rotate 90° clockwise), I (rotate 180° clockwise), and B (rotate 270° clockwise).
// The default value is the orientation configured via the ^FW command, which itself defaults to N (no rotation).
Orientation FieldOrientation
// The bar code height, in dots.
// Any number between 1 and 32,000 may be used.
// The default value is the bar code height configured via the ^BY command, which itself defaults to 10.
Height int
// Whether or not to include human-readable text with the bar code.
// Valid values are Y and N.
// The default value is Y (include human-readable text).
Line bool
// Whether or not to place the human-readable text above the bar code.
// Valid values are Y and N.
// The default value is N (if printed, text is placed below the bar code).
LineAbove bool
}
type BarcodeEan13WithData ¶ added in v1.29.0
type BarcodeEan13WithData struct {
ReversePrint
BarcodeEan13
Width int
Position LabelPosition
Data string
}
type BarcodeMode ¶
type BarcodeMode int
const ( BarcodeModeNo BarcodeMode = 0 BarcodeModeUcc BarcodeMode = 1 BarcodeModeAutomatic BarcodeMode = 2 BarcodeModeEan BarcodeMode = 3 )
type BarcodePdf417 ¶
type BarcodePdf417 struct {
// The bar code orientation to use.
// Valid values are N (no rotation),
// R (rotate 90° clockwise),
// I (rotate 180° clockwise), and B (rotate 270° clockwise).
// The default value is the orientation configured via the ^FW command, which itself defaults to N (no rotation).
Orientation FieldOrientation
// The bar code row height, in dots.
// Any number between 1 and the label height may be used.
// The default value is the row height necessary for the total bar code height
// to match the bar code height configured via the ^BY command.
RowHeight int
// The level of error correction to apply.
// Any number between 0 and 8 may be used.
// The higher the number, the larger the generated bar code and the more resilient it is to scan errors.
// The default value is 0 (scan errors are detected but not corrected).
Security int
// The number of data columns to encode.
// Any number between 1 and 30 may be used.
// This parameter can be used to control the bar code width.
// The default value depends on the amount of data encoded.
Columns int
// The number of rows to encode.
// Any number between 3 and 90 may be used.
// This parameter can be used to control the bar code height.
// The default value depends on the amount of data encoded.
Rows int
// Whether or not to generate a truncated PDF417 bar code, also known as compact PDF417.
// Truncated PDF417 bar codes are narrower because they do not include right row indicators,
// but should only be used when label damage is unlikely. Valid values are Y and N.
// The default value is N (do not truncate).
Truncate bool
}
type BarcodePdf417WithData ¶
type BarcodePdf417WithData struct {
ReversePrint
BarcodePdf417
Position LabelPosition
Data string
}
type BarcodeQr ¶
type BarcodeQr struct {
// The bar code magnification to use.
// Any number between 1 and 10 may be used.
// The default value depends on the print density being used.
Magnification int
}
type BarcodeQrWithData ¶
type BarcodeQrWithData struct {
ReversePrint
BarcodeQr
Height int
Position LabelPosition
Data string
}
func (*BarcodeQrWithData) GetInputData ¶
func (barcode *BarcodeQrWithData) GetInputData() (string, QrErrorCorrectionLevel, QrCharacterMode, error)
type DatamatrixRatio ¶
type DatamatrixRatio int
const ( DatamatrixRatioSquare DatamatrixRatio = 1 DatamatrixRatioRectangular DatamatrixRatio = 2 )
type FieldAlignment ¶ added in v1.26.3
type FieldAlignment int
The origin alignment to use. Not the same as text alignment for text block
const ( FieldAlignmentLeft FieldAlignment = 0 FieldAlignmentRight FieldAlignment = 1 // automatic alignment based on the direction of the field data text FieldAlignmentAuto FieldAlignment = 2 )
type FieldBlock ¶
type FieldBlock struct {
// The maximum text block width, in dots.
// Text longer than this width is wrapped to another line.
// Any number between 0 and 9,999 may be used. The default value is 0, which is rarely useful.
MaxWidth int
// The maximum number of text lines to allow.
// If the text does not fit on the specified number of lines, any remaining text is drawn over the previous text on the last line.
// Any number between 1 and 9,999 may be used. The default value is 1.
MaxLines int
// Extra spacing to add between lines, in dots.
// Positive numbers increase the distance between lines, negative numbers decrease the distance between lines.
// Any number between -9,999 and 9,999 may be used. The default value is 0.
LineSpacing int
// The text alignment to apply to the text block.
// Valid values are L (left), R (right), C (center) and J (justified).
// The default value is L (left).
Alignment TextAlignment
// The hanging indent to apply to all lines except the first line, in dots.
// Any number between 0 and 9,999 may be used. The default value is 0.
HangingIndent int
}
type FieldInfo ¶ added in v1.28.0
type FieldInfo struct {
ReversePrint
Element any
Font FontInfo
Position LabelPosition
Alignment FieldAlignment
Width int
WidthRatio float64
Height int
CurrentCharset int
}
type FieldOrientation ¶
type FieldOrientation int
const ( // no rotation FieldOrientationNormal FieldOrientation = 0 // rotate 90° clockwise FieldOrientation90 FieldOrientation = 1 // rotate 180° clockwise FieldOrientation180 FieldOrientation = 2 // rotate 270° clockwise FieldOrientation270 FieldOrientation = 3 )
func (FieldOrientation) GetDegrees ¶
func (v FieldOrientation) GetDegrees() float64
type FontInfo ¶
type FontInfo struct {
Name string
Width float64
Height float64
Orientation FieldOrientation
CustomFont *truetype.Font
}
func (FontInfo) IsCustomFont ¶ added in v1.38.0
func (FontInfo) IsStandardFont ¶ added in v1.26.1
func (FontInfo) WithAdjustedSizes ¶
Bitmap fonts (everything other than font 0) cannot be freely scaled their size should always divide by their base size without remainder so we need to adjust them NOTE: in order to emulate Zebra fonts 0, A-H we use only 2 different TTF fonts so don't confuse Zebra and our fonts, they are not the same thing
type GraphicBox ¶
type GraphicBox struct {
ReversePrint
Position LabelPosition
Width int
Height int
BorderThickness int
CornerRounding int
LineColor LineColor
}
type GraphicCircle ¶
type GraphicCircle struct {
ReversePrint
Position LabelPosition
// The diameter of the circle, in dots.
// Any number between 3 and 4,095 may be used.
// The default value is 3.
CircleDiameter int
// The line thickness to use to draw the circle, in dots.
// Any number between 1 and 4,095 may be used.
// The default value is 1.
BorderThickness int
// The line color to use to draw the circle.
// Valid values are B (black) and W (white).
// The default value is B (black).
LineColor LineColor
}
type GraphicDiagonalLine ¶
type GraphicDiagonalLine struct {
ReversePrint
Position LabelPosition
Width int
Height int
BorderThickness int
LineColor LineColor
TopToBottom bool
}
type GraphicField ¶
type GraphicField struct {
ReversePrint
Position LabelPosition
// The format of the image data contained in the fifth parameter.
// Valid values are A (hexadecimal format), B (raw binary format), and C (AR compressed).
// There is no default value.
Format GraphicFieldFormat
// The total number of data bytes in the fifth parameter.
// The value of this parameter is always the same as totalBytes,
// except in the case of format C (AR compressed) which is very rarely used.
DataBytes int
// The total number of bytes in the image.
// Because each pixel in the image uses 1 bit, this value should be the total number of pixels in the image,
// divided by 8 (since there are 8 bits per byte).
// There is no default value.
TotalBytes int
// The number of bytes per pixel row in the image.
// Because each pixel in the image uses 1 bit, this value should be the pixel width of the image,
// divided by 8 (since there are 8 bits per byte).
// There is no default value.
RowBytes int
// The image data, in the format specified in the first parameter.
// There is no default value
Data []byte
// The horizontal magnification to apply to the image. Any number between 1 and 10 may be used. The default value is 1.
MagnificationX int
// The vertical magnification to apply to the image. Any number between 1 and 10 may be used. The default value is 1.
MagnificationY int
}
type GraphicFieldFormat ¶
type GraphicFieldFormat int
const ( GraphicFieldFormatHex GraphicFieldFormat = 1 GraphicFieldFormatRaw GraphicFieldFormat = 2 GraphicFieldFormatAR GraphicFieldFormat = 3 )
type GraphicSymbol ¶
type GraphicSymbol struct {
Width float64
Height float64
Orientation FieldOrientation
}
type LabelPosition ¶
func (LabelPosition) Add ¶
func (p LabelPosition) Add(pos LabelPosition) LabelPosition
type Maxicode ¶
type Maxicode struct {
// The mode to use to encode the bar code data.
// Valid values are 2 (numeric postal code),
// 3 (alphanumeric postal code),
// 4 (standard), 5 (full EEC), and 6 (reader programming).
// The default value is 2 (numeric postal code).
Mode int
}
type MaxicodeWithData ¶
type MaxicodeWithData struct {
ReversePrint
Code Maxicode
Position LabelPosition
Data string
}
func (*MaxicodeWithData) GetInputData ¶
func (barcode *MaxicodeWithData) GetInputData() (string, error)
type QrCharacterMode ¶ added in v1.26.0
type QrCharacterMode byte
const ( QrCharacterModeAutomatic QrCharacterMode = 0 QrCharacterModeBinary QrCharacterMode = 'B' QrCharacterModeNumeric QrCharacterMode = 'N' QrCharacterModeAlphanumeric QrCharacterMode = 'A' QrCharacterModeKanji QrCharacterMode = 'K' )
type QrErrorCorrectionLevel ¶
type QrErrorCorrectionLevel byte
const ( QrErrorCorrectionH QrErrorCorrectionLevel = 'H' QrErrorCorrectionQ QrErrorCorrectionLevel = 'Q' QrErrorCorrectionM QrErrorCorrectionLevel = 'M' QrErrorCorrectionL QrErrorCorrectionLevel = 'L' )
type RecalledField ¶ added in v1.28.0
type RecalledField struct {
StoredField
Data string
}
func (*RecalledField) Resolve ¶ added in v1.28.0
func (f *RecalledField) Resolve() (any, error)
type RecalledFieldData ¶ added in v1.28.0
type RecalledFormat ¶ added in v1.28.0
type RecalledFormat struct {
Inverted bool
// contains filtered or unexported fields
}
func (*RecalledFormat) AddElement ¶ added in v1.28.0
func (rf *RecalledFormat) AddElement(element any) bool
func (*RecalledFormat) ResolveElements ¶ added in v1.28.0
func (rf *RecalledFormat) ResolveElements() ([]any, error)
type ReversePrint ¶
type ReversePrint struct {
Value bool
}
func (*ReversePrint) IsReversePrint ¶
func (p *ReversePrint) IsReversePrint() bool
type StoredField ¶ added in v1.28.0
type StoredFormat ¶ added in v1.28.0
func (*StoredFormat) ToRecalledFormat ¶ added in v1.28.0
func (sf *StoredFormat) ToRecalledFormat() *RecalledFormat
type StoredGraphics ¶
type StoredGraphics struct {
// The image data, in hexadecimal format. There is no default value.
Data []byte
// The total number of bytes in the image.
// Because each pixel in the image uses 1 bit, this value should be the total number of pixels in the image, divided by 8 (since there are 8 bits per byte).
// There is no default value.
TotalBytes int
// The number of bytes per pixel row in the image.
// Because each pixel in the image uses 1 bit, this value should be the pixel width of the image, divided by 8 (since there are 8 bits per byte).
// The default value is 1, which is almost always incorrect.
RowBytes int
}
type TextAlignment ¶
type TextAlignment int
const ( TextAlignmentLeft TextAlignment = 0 TextAlignmentRight TextAlignment = 1 TextAlignmentJustified TextAlignment = 2 TextAlignmentCenter TextAlignment = 3 )
type TextField ¶
type TextField struct {
ReversePrint
Font FontInfo
Position LabelPosition
Alignment FieldAlignment
Text string
Block *FieldBlock
}
Source Files
¶
- barcode_128.go
- barcode_2of5.go
- barcode_39.go
- barcode_aztec.go
- barcode_datamatrix.go
- barcode_ean13.go
- barcode_info.go
- barcode_pdf417.go
- barcode_qr.go
- field_alignment.go
- field_block.go
- field_info.go
- field_orientation.go
- font.go
- graphic_box.go
- graphic_circle.go
- graphic_diagonal_line.go
- graphic_field.go
- graphic_symbol.go
- label_position.go
- line_color.go
- maxicode.go
- reverse_print.go
- stored_format.go
- stored_graphics.go
- text_alignment.go
- text_field.go
Click to show internal directories.
Click to hide internal directories.