Package totalcross.io.device.escpos
Class EscPosBarcode
- java.lang.Object
-
- totalcross.io.device.escpos.EscPosBarcode
-
- All Implemented Interfaces:
EscPosPrintObject
public class EscPosBarcode extends java.lang.Object implements EscPosPrintObject
Printable ESC/POS bar code representation.- Since:
- TotalCross 4.2.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEscPosBarcode.EscPosBarcodeType
-
Field Summary
Fields Modifier and Type Field Description static byteTEXTPRINTINGPOSITION_ABOVEstatic byteTEXTPRINTINGPOSITION_BELOWstatic byteTEXTPRINTINGPOSITION_BOTHstatic byteTEXTPRINTINGPOSITION_NONE
-
Constructor Summary
Constructors Constructor Description EscPosBarcode(EscPosBarcode.EscPosBarcodeType type, java.lang.CharSequence data)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EscPosBarcodeheight(int n)Sets the bar code height to n dots.EscPosBarcodetextPrintingPosition(byte textPrintingPosition)Selects the print position of Human Readable Interpretation (HRI) characters when printing a bar code.EscPosBarcodewidth(int n)Sets the bar code width.voidwrite(java.io.OutputStream out)Writes this printable object to the given output stream.
-
-
-
Field Detail
-
TEXTPRINTINGPOSITION_NONE
public static final byte TEXTPRINTINGPOSITION_NONE
- See Also:
- Constant Field Values
-
TEXTPRINTINGPOSITION_ABOVE
public static final byte TEXTPRINTINGPOSITION_ABOVE
- See Also:
- Constant Field Values
-
TEXTPRINTINGPOSITION_BELOW
public static final byte TEXTPRINTINGPOSITION_BELOW
- See Also:
- Constant Field Values
-
TEXTPRINTINGPOSITION_BOTH
public static final byte TEXTPRINTINGPOSITION_BOTH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EscPosBarcode
public EscPosBarcode(EscPosBarcode.EscPosBarcodeType type, java.lang.CharSequence data)
-
-
Method Detail
-
textPrintingPosition
public EscPosBarcode textPrintingPosition(byte textPrintingPosition)
Selects the print position of Human Readable Interpretation (HRI) characters when printing a bar code.- Parameters:
textPrintingPosition-- Returns:
-
height
public EscPosBarcode height(int n)
Sets the bar code height to n dots.The original ESC/POS Manual defines the bar code height in dots, but the actual size of a dot and the default value for n and may differ for each device.
For instance, the default bar code height for devices with dot size of 0.125mm (1/203 inches) is 162.
Known default values:
- Datecs DPP-350: 162
- Leopardo A7: 36
- Parameters:
n-- Returns:
-
width
public EscPosBarcode width(int n)
Sets the bar code width.The units for n depends on the printer model - usually 2 ≤ n ≤ 6 with default value 3.
Known models range and default values:
- Datecs DPP-350: 2 ≤ n ≤ 4 with default value of 3
- Leopardo A7: 1 ≤ n ≤ 4 with default value of 2
- Parameters:
n-- Returns:
-
write
public void write(java.io.OutputStream out) throws java.io.IOExceptionDescription copied from interface:EscPosPrintObjectWrites this printable object to the given output stream.- Specified by:
writein interfaceEscPosPrintObject- Parameters:
out- the output stream- Throws:
java.io.IOException- if an I/O error occurs.
-
-