public class EscPosBarcode extends java.lang.Object implements EscPosPrintObject
Modifier and Type | Class and Description |
---|---|
static class |
EscPosBarcode.EscPosBarcodeType |
Modifier and Type | Field and Description |
---|---|
static byte |
TEXTPRINTINGPOSITION_ABOVE |
static byte |
TEXTPRINTINGPOSITION_BELOW |
static byte |
TEXTPRINTINGPOSITION_BOTH |
static byte |
TEXTPRINTINGPOSITION_NONE |
Constructor and Description |
---|
EscPosBarcode(EscPosBarcode.EscPosBarcodeType type,
java.lang.CharSequence data) |
Modifier and Type | Method and Description |
---|---|
EscPosBarcode |
height(int n)
Sets the bar code height to n dots.
|
EscPosBarcode |
textPrintingPosition(byte textPrintingPosition)
Selects the print position of Human Readable Interpretation (HRI) characters when printing a
bar code.
|
EscPosBarcode |
width(int n)
Sets the bar code width.
|
void |
write(java.io.OutputStream out)
Writes this printable object to the given output stream.
|
public static final byte TEXTPRINTINGPOSITION_NONE
public static final byte TEXTPRINTINGPOSITION_ABOVE
public static final byte TEXTPRINTINGPOSITION_BELOW
public static final byte TEXTPRINTINGPOSITION_BOTH
public EscPosBarcode(EscPosBarcode.EscPosBarcodeType type, java.lang.CharSequence data)
public EscPosBarcode textPrintingPosition(byte textPrintingPosition)
textPrintingPosition
- public EscPosBarcode height(int n)
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:
n
- public EscPosBarcode width(int n)
The units for n depends on the printer model - usually 2 ≤ n ≤ 6 with default value 3.
Known models range and default values:
n
- public void write(java.io.OutputStream out) throws java.io.IOException
EscPosPrintObject
write
in interface EscPosPrintObject
out
- the output streamjava.io.IOException
- if an I/O error occurs.