|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jrefinery.report.targets.pageable.output.PrinterCommandSet | +--com.jrefinery.report.targets.pageable.output.IBMPrinterCommandSet
Implements the printer command set for IBM compatible printers.
This implementation is untested. If you have access to an IBM 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 | |
IBMPrinterCommandSet(java.io.OutputStream out,
java.awt.print.PageFormat format,
int defaultCPI,
int defaultLPI)
Creates a new IBMPrinterCommandSet. |
Method Summary | |
void |
endPage()
This implementation send the form feed command, IBM printers handle the bottom border automaticly. |
boolean |
isEncodingSupported(java.lang.String encoding)
Checks, whether the given encoding string is supported by this printer command set. |
void |
setAutoLF(boolean autoLF)
Defines whether to print in AutoLF mode. |
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 |
setVerticalBorder(int top,
int bottom)
Defines the horizontal borders for the current paper. |
void |
startLine()
This implementation is empty, as IBM printers handle the left border automaticly. |
void |
startPage()
This implementation is empty, as IBM printers handle the top borders automaticly. |
Methods inherited from class com.jrefinery.report.targets.pageable.output.PrinterCommandSet |
endLine, flush, getBorderBottom, getBorderLeft, getBorderRight, getBorderTop, getCharacterWidth, getCodepage, getDefaultCPI, getDefaultLPI, getFont, getLineSpacing, getOut, getPageFormat, getPaperSize, isAutoLf, isBold, isItalic, isLetterQuality, isStrikethrough, isUnderline, printChunk, printEmptyChunk, resetPrinter, setPrintQuality |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public IBMPrinterCommandSet(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 setVerticalBorder(int top, int bottom) throws java.io.IOException
setVerticalBorder
in class PrinterCommandSet
top
- the number of blank lines printed on the start of a page.bottom
- the number of blank lines printed at the end of a page
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
- the new autoLF state
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 startPage() throws java.io.IOException
startPage
in class PrinterCommandSet
java.io.IOException
- if there was an IOError while writing the commandpublic void endPage() throws java.io.IOException
endPage
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 |