public class IBMCompatiblePrinterDriver extends Object implements PrinterDriver
Modifier and Type | Class and Description |
---|---|
static class |
IBMCompatiblePrinterDriver.GenericIBMPrinterSpecification |
Modifier and Type | Field and Description |
---|---|
static int |
QUALITY_DEFAULT |
static int |
QUALITY_DRAFT |
static int |
QUALITY_ENHANCED_LETTER |
static int |
QUALITY_FAST_DRAFT |
static int |
QUALITY_LETTER |
static int |
QUALITY_UNDEFINED |
Constructor and Description |
---|
IBMCompatiblePrinterDriver(OutputStream out,
float charsPerInch,
float linesPerInch) |
Modifier and Type | Method and Description |
---|---|
void |
endLine(boolean overflow)
Ends a new line.
|
void |
endPage(boolean overflow)
Ends the current page.
|
void |
flush()
Flushes the output stream.
|
float |
getCharactersPerInch()
Gets the default character width in CPI.
|
protected EncodingUtilities |
getEncodingUtilities(String encoding) |
float |
getLinesPerInch()
Gets the default line height.
|
int |
getPrintQuality() |
boolean |
isAutoLF() |
void |
printChunk(PlaintextDataChunk chunk)
Prints a single text chunk at the given position on the current line.
|
void |
printEmptyChunk(int count)
Prints an empty chunk.
|
void |
printRaw(byte[] raw)
Prints some raw content.
|
void |
sendLineSpacing(int lineHeight)
Defines the line spacing for the printer.
|
void |
setAutoLF(boolean autoLF) |
void |
setPrintQuality(int printQuality) |
void |
startLine()
Starts a new line.
|
void |
startPage(Paper paper,
String encoding)
Resets the printer and starts a new page.
|
public static final int QUALITY_UNDEFINED
public static final int QUALITY_FAST_DRAFT
public static final int QUALITY_DRAFT
public static final int QUALITY_LETTER
public static final int QUALITY_ENHANCED_LETTER
public static final int QUALITY_DEFAULT
public IBMCompatiblePrinterDriver(OutputStream out, float charsPerInch, float linesPerInch)
public void setAutoLF(boolean autoLF)
public boolean isAutoLF()
public int getPrintQuality()
public void setPrintQuality(int printQuality)
public void endLine(boolean overflow) throws IOException
endLine
in interface PrinterDriver
overflow
- IOException
- if an IOError occures.public void endPage(boolean overflow) throws IOException
endPage
in interface PrinterDriver
overflow
- IOException
- if there was an IOError while writing the commandpublic void flush() throws IOException
flush
in interface PrinterDriver
IOException
- if an IOError occured.public float getCharactersPerInch()
getCharactersPerInch
in interface PrinterDriver
public float getLinesPerInch()
getLinesPerInch
in interface PrinterDriver
public void printChunk(PlaintextDataChunk chunk) throws IOException
printChunk
in interface PrinterDriver
chunk
- the chunk that should be writtenIOException
- if an IO error occured.public void printEmptyChunk(int count) throws IOException
printEmptyChunk
in interface PrinterDriver
IOException
- if an IOError occured.public void printRaw(byte[] raw) throws IOException
printRaw
in interface PrinterDriver
raw
- the content that should be printed.IOException
public void startLine() throws IOException
startLine
in interface PrinterDriver
IOException
- if an IOError occures.public void startPage(Paper paper, String encoding) throws IOException
startPage
in interface PrinterDriver
IOException
- if there was an IOError while writing the commandpublic void sendLineSpacing(int lineHeight) throws IOException
lineHeight
- the height of a single line in points (1/72 inch).IOException
- if an IOException occured while updating the printer state.protected EncodingUtilities getEncodingUtilities(String encoding) throws IOException
IOException
Copyright © 2017 Hitachi Vantara. All rights reserved.