|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jrefinery.report.targets.pageable.output.PrinterCommandSet
com.jrefinery.report.targets.pageable.output.EpsonPrinterCommandSet
Implements the printer command set for Epson ESC/P compatible printers. This implementation assumes that AutoLF is disabled.
This implementation is untested. If you have access to an ESC/P compatible printer, you could try this command set to improve printing quality.
PrinterCommandSet
,
PlainTextOutputTarget
Field Summary |
Fields inherited from class com.jrefinery.report.targets.pageable.output.PrinterCommandSet |
CARRIAGE_RETURN, FORM_FEED, LINE_FEED, SELECT_FONT_COURIER, SELECT_FONT_FROM_MENU, SELECT_FONT_GOTHIC, SELECT_FONT_OCR_A, SELECT_FONT_OCR_B, SELECT_FONT_ORATOR, SELECT_FONT_PRESTIGE, SELECT_FONT_ROMAN, SELECT_FONT_SWISS, SELECT_FONT_SWISS_BOLD, SPACE |
Constructor Summary | |
EpsonPrinterCommandSet(java.io.OutputStream out,
java.awt.print.PageFormat format,
int defaultCPI,
int defaultLPI)
Creates a new EpsonPrinterCommandSet. |
Method Summary | |
boolean |
isAutoLf()
Always returns false, as ESC/P has we assume AutoLF to be disabled for all Epson-Printers. |
boolean |
isEncodingSupported(java.lang.String encoding)
Checks, whether the given encoding string is supported by this printer command set. |
void |
resetPrinter()
Resets the printer to the default values. |
void |
setAutoLF(boolean autoLF)
This implementation is empty, the Epson Printer Language defines no command to alter the AutoLF feature from within a programm, we assume no AutoLF. |
void |
setCharacterWidth(byte charWidth)
Defines the character width for the current font. |
void |
setCodePage(java.lang.String codepage)
Defines the code page for the text to be printed. |
void |
setFont(byte fontSelection)
Defines the new font for the printer. |
void |
setFontStyle(boolean bold,
boolean italic,
boolean underline,
boolean strike)
Defines the font style for the printed text. |
void |
setHorizontalBorder(int left,
int right)
Defines the horizontal borders for the current paper. |
void |
setLineSpacing(int spaceInInch)
Defines the line spacing for the printer, the spacing is given in 1/1440 inches. |
void |
setPaperSize(int lines)
Defines the papersize in lines. |
void |
setPrintQuality(boolean letterQuality)
Defines the printing quality for the printed text. |
void |
startLine()
This implementation is empty, as epson printers handle the left border automaticly. |
Methods inherited from class com.jrefinery.report.targets.pageable.output.PrinterCommandSet |
endLine, endPage, flush, getBorderBottom, getBorderLeft, getBorderRight, getBorderTop, getCharacterWidth, getCodepage, getDefaultCPI, getDefaultLPI, getFont, getLineSpacing, getOut, getPageFormat, getPaperSize, isBold, isItalic, isLetterQuality, isStrikethrough, isUnderline, printChunk, printEmptyChunk, setVerticalBorder, startPage |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EpsonPrinterCommandSet(java.io.OutputStream out, java.awt.print.PageFormat format, int defaultCPI, int defaultLPI)
out
- the target output streamformat
- the pageformat of the used reportdefaultCPI
- the characters-per-inch for the output.defaultLPI
- the lines-per-inch for the output.Method Detail |
public void setFont(byte fontSelection) throws java.io.IOException
To use these fonts, specify the font parameter for the escape sequence 0x1b, 0x6b, [font-selection] as defined in your printers reference manual.
setFont
in class PrinterCommandSet
fontSelection
- the printers font selection token.
java.io.IOException
- if there was an IOError while writing the command.public void setCharacterWidth(byte charWidth) throws java.io.IOException
setCharacterWidth
in class PrinterCommandSet
charWidth
- the character width in CPI.
java.io.IOException
- if there was an IOError while writing the command or if the
character width is not supported by the printer.public void setFontStyle(boolean bold, boolean italic, boolean underline, boolean strike) throws java.io.IOException
setFontStyle
in class PrinterCommandSet
bold
- true, if the text should be printed in bold mode.italic
- true, if the text should be italic, false otherwiseunderline
- true, if the text should be underlined, false otherwisestrike
- true, if the text should be strikethrough, false otherwise
java.io.IOException
- if there was an IOError while writing the commandpublic void setPaperSize(int lines) throws java.io.IOException
setPaperSize
in class PrinterCommandSet
lines
- the number of lines that could be printed on a single page.
java.io.IOException
- if there was an IOError while writing the commandpublic void setHorizontalBorder(int left, int right) throws java.io.IOException
setHorizontalBorder
in class PrinterCommandSet
left
- the number of spaces printed on the start of a line.right
- the number of spaces left free on the right paper border.
java.io.IOException
- if an IOException occured while updating the printer state.public void setLineSpacing(int spaceInInch) throws java.io.IOException
setLineSpacing
in class PrinterCommandSet
spaceInInch
- the linespacing in 1/1440 inches.
java.io.IOException
- if an IOException occured while updating the printer state.public void setCodePage(java.lang.String codepage) throws java.io.IOException
setCodePage
in class PrinterCommandSet
codepage
- the new codepage that should be used.
java.io.IOException
- if there was an IOError while writing the commandpublic void setAutoLF(boolean autoLF) throws java.io.IOException
setAutoLF
in class PrinterCommandSet
autoLF
- this parameter is ignored.
java.io.IOException
- if there was an IOError while writing the commandpublic boolean isAutoLf()
isAutoLf
in class PrinterCommandSet
public void setPrintQuality(boolean letterQuality) throws java.io.IOException
setPrintQuality
in class PrinterCommandSet
letterQuality
- true, if letter quality should be used, false for draft-quality
java.io.IOException
- if there was an IOError while writing the commandpublic void startLine() throws java.io.IOException
startLine
in class PrinterCommandSet
java.io.IOException
- if there was an IOError while writing the commandpublic void resetPrinter() throws java.io.IOException
resetPrinter
in class PrinterCommandSet
java.io.IOException
- if there was an IOError while writing the commandpublic boolean isEncodingSupported(java.lang.String encoding)
isEncodingSupported
in class PrinterCommandSet
encoding
- the encoding that should be tested.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |