public class MPTPrinter extends BluetoothPrinter
ESC, GS, IMAGE_MODE_24_DOUBLE, IMAGE_MODE_24_SINGLE, IMAGE_MODE_8_DOUBLE, IMAGE_MODE_8_SINGLE| Constructor and Description |
|---|
MPTPrinter()
Creates a new CitizenPrinter instance, using PortConnector.BLUETOOTH port at 57600 baud rate.
|
MPTPrinter(PortConnector con)
Creates a new CitizenPrinter instance, using the given PortConnector as bridge to the printer.
|
MPTPrinter(Stream con)
Creates a new CitizenPrinter instance, using the given Stream as bridge to the printer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
bold(boolean on)
Sets bold state.
|
void |
reset()
Resets the printer, canceling previous font and line spacing
|
void |
setCharSize(boolean doubleW,
boolean doubleH)
Sets the character size
|
void |
setDensity(int n)
Sets the font density, between 0 and 5.
|
void |
setFont(boolean bold,
boolean doubleWidth,
boolean doubleHeight,
boolean underline)
Sets the current font based on the given attributes.
|
void |
setHorizontalAlignment(int v)
Sets the horizontal text alignment.
|
void |
setLineHeight(int n)
User-defined line height (n / 203 inches height).
|
void |
setRotation1800(boolean on)
Enables 180-degree rotation.
|
void |
setRotation90(boolean on)
Enables 90-degree rotation.
|
void |
setSpaceWidth(int w)
Sets the space character width, between 0 and 32.
|
void |
setXPos(int x)
Sets the absolute position to start printing.
|
void |
singleLineHeight()
Single-space line height.
|
void |
turnOff()
Turns off the printer.
|
public MPTPrinter()
throws IOException
IOExceptionpublic MPTPrinter(PortConnector con) throws IOException
IOExceptionpublic MPTPrinter(Stream con) throws IOException
IOExceptionpublic void reset()
throws IOException
IOExceptionpublic void setFont(boolean bold,
boolean doubleWidth,
boolean doubleHeight,
boolean underline)
throws IOException
IOExceptionpublic void setCharSize(boolean doubleW,
boolean doubleH)
throws IOException
IOExceptionpublic void setSpaceWidth(int w)
throws IOException
IOExceptionpublic void setXPos(int x)
throws IOException
IOExceptionpublic void turnOff()
throws IOException
IOExceptionpublic void singleLineHeight()
throws IOException
IOExceptionpublic void setLineHeight(int n)
throws IOException
IOExceptionpublic void bold(boolean on)
throws IOException
IOExceptionpublic void setRotation90(boolean on)
throws IOException
IOExceptionpublic void setRotation1800(boolean on)
throws IOException
IOExceptionpublic void setDensity(int n)
throws IOException
IOExceptionpublic void setHorizontalAlignment(int v)
throws IOException
IOException